# ServiceNow

ServiceNow is a multifunctional platform seen in many organisations. It frequently handles tasks related to asset management and service desk activities

Our ServiceNow integration will send a create a new ticket in ServiceNow Service Desk Incidents. The alert will show details on the event it relates to, and provide a link back to the event details in the seedata.io platform

Fields required are as follows:

* Instance name (required)
* Client ID (required)
* Client secret (required)
* Refresh token (required)

## Step 1: Get your Client ID and Client Secret

Documentation by ServiceNow is available here : <https://docs.servicenow.com/bundle/xanadu-platform-security/page/administer/security/task/t_CreateEndpointforExternalClients.html>

1. Log in to you serviceNow instance and go to **All** > **System OAuth** > **Application Registry**
2. Create a new registry
   1. Select \`[Create an OAuth API endpoint for external clients](https://dev166511.service-now.com/wizard_view.do?sys_action=sysverb_wizard_ans\&WIZARD:action=follow\&wiz_referring_url=oauth_entity_list.do?sys_id=-1@99@sys_target=oauth_entity@99@sysparm_fixed_query=@99@sysparm_group_sort=@99@sysparm_parent=2c7cab53d7232100f20bc8170e61036b@99@sysparm_query=type%3dclient%5eORtype%3doauth_provider@99@sysparm_target=@99@sysparm_view=\&wiz_collection_key=\&wiz_collectionID=\&wiz_collection=\&wiz_collection_related_field=\&wiz_view=\&wiz_action=sysverb_new\&sys_id=b27e2f53d7232100f20bc8170e610304\&sysparm_query=type=client^ORtype=oauth_provider\&sysparm_target=\&sys_target=oauth_entity)\` when prompted
   2. Give the registry a name & set the redirect url to “[https://\<your\_instance\_name>.service-now.com/login.do](https://dev166511.service-now.com/login.do)“
   3. Add an available auth scope / or create a new auth scope for this registry.
   4. COPY THE CLIENT ID & CLIENT SECRET.

## Step 2: Get your refresh token

1. Open terminal / command prompt and run the following command (after populating any variable within <> using the appropriate value

   ```
   $ curl -d "grant_type=password&client_id=<CLIENT-ID>
   &client_secret=<CLIENT-SECRET>
   &username=admin&password=admin"
   POST https://<INSTANCE-NAME>.service-now.com/oauth_token.do
   ```
2. This will return you a value for REFRESH-TOKEN

## Step 3: Create your new ServiceNow Alert Integration

1. Log in to app.seedata.io
2. Go to Settings in the left menu bar, then Alerts, and click ADD NEW
3. Set the type to ServiceNow
4. Add a name and description for this alert integration, to help you identify it from others in your list
5. Select the event priorities you wish alerts to be sent for
6. Add the values obtained from earlier steps
7. Any alerts to the servicenow alert type can be found in the following path in servicenow.
   1. **All > service desk > incidents**

{% hint style="info" %}
If you want to create a Service Now instance to test this alert integration, follow these steps

1. Signin/signup to servicenow - [ServiceNow Developers](https://developer.servicenow.com/dev.do#!/home)
2. Select the ‘developer programme’ app on first sign in
3. Standup a developer instance
4. Save the instance admin username & password.
5. Install & enable the oauth plugin for instance - [Product Documentation | ServiceNow](https://docs.servicenow.com/bundle/tokyo-platform-security/page/administer/security/task/t_ActivateOAuth.html)
   1. **All > system applications > all available applications > all**
   2. install & enable oauth 2 plugin
      {% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.seedata.io/tutorials/managing-your-alerts/servicenow.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
