Introduction
In this article you will learn how you can create a Task in ServiceNow when a CustomerGauge survey gets completed using our Outgoing Webhooks Functionality. This helps if your organization is Closing the Loop using ServiceNow.
In order to leverage this Outgoing Webhooks you do need to be a customer of both ServiceNow and CustomerGauge.
Business use case
Creating a Task in ServiceNow whenever a CustomerGauge survey gets completed greatly helps if you're Closing the Loop using ServiceNow.
Preparations
Requirements
In order to set up an Outgoing Webhook to ServiceNow, you'll need the following:
- Admin access in CustomerGauge;
- Access to OAuth2 Application Registries in ServiceNow.
Authentication
Each of the recipes for ServiceNow will require a valid authentication. You should follow the steps as described below for each of your Outgoing Webhooks to ServiceNow.
- In ServiceNow, head over to Organization → Users.
- Create a new User - this user will be used in the integration.
- User ID: Define the User ID for the user, for example "customergauge.webhook".
- First Name: Give a first name to the user, for example "CustomerGauge".
- Last Name: Give a last name to the user, for example "Webhook".
- Password: Give a secure password to the user, this will be used later on in CustomerGauge.
- Locked out: Ensure this is turned off.
- Active: Ensure this is turned on.
- Web service access only: Ensure this is turned on.
- You can leave all other fields as-is.
- User ID: Define the User ID for the user, for example "customergauge.webhook".
- In ServiceNow, head over to System OAuth → Application Registries.
- Create a new Application Registry:
- Select "Create an OAuth API endpoint for external clients"
- Name: Give a name to your OAuth client that you'll recognize in the future.
- Client ID: You can't edit this, but you'll need it later on in CustomerGauge.
- Client Secret: Leave this blank - a value will be generated upon saving.
- Redirect URL: You can skip this option, it's not relevant to the Outgoing Webhook.
- Logo URL: You can skip this option, it's not relevant to the Outgoing Webhook.
- Comments: You could expand on the purpose of the OAuth client.
- Application: You can skip this option, it's not relevant to the Outgoing Webhook.
- Accessible from: Ensure that this is "all application scopes".
- Active: Ensure that this is turned on.
- Refresh Token Lifespan: We recommend keeping this at the default 8,640,000.
- Access Token Lifespan: We commend keeping this at the default 1,800.
- Select "Create an OAuth API endpoint for external clients"
- In CustomerGauge, head over to Data → Integrations → Webhooks → Authentications.
- Create a New Authentication:
- System: Select "Other".
- Name: Give your Authentication a name that you'll recognize in the future.
- Grant Type: Select "Resource Owner Password Credentials".
- Access Token URL: Add the following URL, replacing <subdomain>with your ServiceNow domain:
https://<subdomain>.service-now.com/oauth_token.do
- Username: Add the Username of the ServiceNow user you created earlier.
- Password: Add the Password of the ServiceNow user you created earlier.
- Client ID: Copy/Paste the value from the "Client ID" of the OAuth Client you created in ServiceNow.
- Client Secret: Copy/Paste the "Client Secret" of the OAuth Client you created in ServiceNow.
- Scope: You can ignore this option for ServiceNow.
- System: Select "Other".
- Press the Save button, and you should be ready to set up your Outgoing Webhook!
Create a Task when a Survey gets completed
How to set-up
- In CustomerGauge, in the Outgoing Webhooks page, click the New Webhook button, followed by the Outgoing option.
- In the Filters step you can add a combination of fields and their value that a survey response needs to match in order to trigger the Webhook.
Survey Responses that have Touchpoint "Support", and Area being either "British Isles" or "Benelux" qualify to trigger this Webhook.
- In the Authentication step, select your Authentication from the drop-down.
- In the API Setup step you'll need to set up your API request. We'll walk you through each of the fields that you'd need to fill in to create a Task in ServiceNow.
- Method: POST
- API URL:
https://<subdomain>.service-now.com/api/now/table/task
- Custom Headers: Add the following header to the Custom Headers section:
Header Value Content-Type application/json Content-Type will ensure your Request Body is understood by ServiceNow.
- Request Body: The Request Body is used to send your Survey Response data to ServiceNow. Think of this as the mapping between CustomerGauge and ServiceNow. We'll provide an example, but you may want to make changes to add data important to you. See the list of Available Data Fields to find out what data is available from CustomerGauge to be sent over. The columns of the Task table in ServiceNow can be explored by navigating to System Definition → Tables & Columns, and then selecting the Task table.
Example Request Body:{ "ticket": { "comment": { "body": "The smoke is very colorful." }, "priority": "urgent", "subject": "My webhook is on fire!" } }
- In the Details step, the last step, give a name to your Webhook, and decide to Activate the Webhook immediately or not. Once you've done that, click the Save button, and you're all done! You can see whether your Webhook being (de-)activated in the Status column in the overview of Webhooks. If you'd like to activate or deactivate your Webhook at a later time you can always Edit your Webhook and navigate to the Details step to activate or deactivate it.