Integrate ServiceNow and SharePoint Using Microsoft Flow to Create an IT Support Ticket
Recently, I was asked to explore options to integrate SharePoint IT Support Request Form with ServiceNow available on the corporate intranet.
- Staff using IT support request form (SharePoint custom list) available on the corporate intranet
- Send a confirmation email to the person created a request
- Create a ticket in the ServiceNow incident table
- Update the ticket number back to SharePoint list for any future verification.
Prerequisite from ServiceNow:
- A user account with appropriate permission to create an entry in the incident table. More information here.
- Method URI which can be generated through ServiceNow REST API Explorer.
- JSON response to create a payload and parsing the JSON object – I have selected only few fields required for this blog, but you can select more fields as appropriate for your scenario
- Setup REST Auth 2.0 in ServiceNow. For this blog, I am using Basic authentication which is not secure (plain text).
I have a custom list with only three fields. I have customised the Form using PowerApps to disable the Incident Number field. We can hide this field if needed e.g. don’t show this if it is a New request but for Edit and View make it disabled.
HTTP POST request to ServiceNow REST API: I generated this through ServiceNow REST API Explorer (amazing tool, if one thing SharePoint could learn from ServiceNow that would be this tool!). Few things to note: I have set sysparm_exclude_reference_link to ‘True’ in order to set the name of the user to contact field. Otherwise, this request by default return an object which is a link to Users’ table. Also, I am passing all the fields required in the URL parameters to keep the response clean. The POST request will work without any parameters but the HTTP response received will be a very long and with necessary information which is not required.
I am using Basic authentication with my username and password with the appropriate role assigned through ServiceNow.
Parse the JSON object received after the request was successful. This will allow us to update the Incident Number returned from ServiceNow to SharePoint list.
“short_description”: “Small Problem Description”,
“description”: “Big description for a small problem”
Lastly, update the SharePoint list item with the Incident Number received from the response.
Here is how the full Flow looks like: