Workflows
Rootly's ServiceNow integration leverages workflows to automatically create and update ServiceNow tickets. If you are unfamiliar with how Workflows function please visit our Workflows documentation first.
This workflow action creates a record in the Incident table (e.g. INC0010001) and links it to the Rootly incident record.
This workflow action updates the data properties of an existing record from the Incident table (e.g. INC0010001).
Work notes are internal comments that can be added to a ServiceNow incident. Work notes cannot be seen by customers.
Comments can be added to a ServiceNow incident and it can be seen by customers.
Adding a confuration item (CI) to an incident is an awkard action due technical limitations of ServiceNow APIs. To facilitate this action we will need to utilize Rootly's HTTP Client workflow action to consolidate mutiple ServiceNow API calls into a single action.
The ServiceNow API we will use to add CIs to an incident is the Table API.
Since ServiceNow API only allows one CI to be added per API call, we will use their Batch API to wrap multiple Table API calls together and leverage Rootly's HTTP Client workflow action to carry out the call.
This field is automatically set for you. You can rename this field to whatever best describes your action. The value in this field does not affect how the workflow action behaves.
This is the endpoint of the ServiceNow Batch API. The value should be in the following format: https://<instance-domain>.com/api/now/v1/batch
This is the API operation. In this case, select POST.
These are the header parameters required by the Batch API. The values are configured in JSON format and includes the authentication token.
If you don't want your username:password to be visible by non-Admins, you can store it as Sercret variable in Rootly.
In this case, set to the following format:
Since this is a POST call, there will be no query parameters. Leave this field empty.
The body is where we want to consolidate individual Table API calls into a single body.
Each body field of the inidividual API calls wrapped inside of the BATCH API have to be base64 encoded.
The format follows something like this:
A common use case is to have the selected Rootly services for an incident be automtically added to the ServiceNow incident as an Affected CIs.
To support this use case, you must have each ServiceNow CI's sys_id linked to their equivalent Rootly services.
The following syntax leverages Liquid syntax to dynamically set each the base64 encoded task and ci_item fields in each Table API call:
Set to 200. Unlike most POST requests that returns 201, ServiceNow's Batch API's POST endpoint returns 200 status code to signify success.
You don't need to fill in the rest of the fields in the workflow action. They are more for debugging and notification usage.