To integrate with ServiceNow may depend on the version of ServiceNow in which they are running due to the features that are available. For calling the Polly API, the outbound REST service will need to be utilized to call out to the Polly API with a well-formatted JSON message.
There are a few ways to make an external API call to Polly when the incident state changes such as using business rules, flow, or workflows.
- Create a new workflow
- Set the trigger to be API
- Add 2 Parameters to represent the audience for who the survey will go to, and the Incident number that triggered the workflow
- Select "audience" for the value of "Send Survey To"
- Create or open a developer instance at https://developer.servicenow.com/app.do#!/instance
- Import this update set: Polly workflow business rule scenario.xml
1. ServiceNow > Retrieved Update Sets
2. Import update Set from XML
3. Upload File
4. Select the Polly update set you just imported
5. Preview Update Set
- Navigate to ServiceNow > Rest Message
1. Select Polly API
2. HTTP Request Tab
x-api-tokento your Polly API Token value and Update
4. HTTP Methods
workflows.triggersendpoint to desired environment
- Set your workflow ID property in ServiceNow
1. search for "
sys_properties.list" in the navigation bar of ServiceNow and hit enter to open system properties
2. Filter the name column to "polly" and find system property called polly.incidentresolution.workflow.id
3. Edit the value to your Polly workflow that you want to trigger and save/update
- Create a ServiceNow user with an email address that matches their Slack email address
- Create an Incident or open an existing one and set the caller to the user created/updated in step 4
- Resolve the incident to trigger workflow
1. "Resolve" button to right of incident form and populate the required resolution fields
To trigger the workflow from ServiceNow, navigate to an incident and set the "Caller" field to the user you configured earlier that contains the email address matching the slack user to receive the survey.
Select "Resolve" on the top left of the incident form and populate the required fields, then select Resolve again.
Should receive a confirmation or an error about the workflow being triggered.