Integrating MuleSoft with ServiceNow Incident Management System

11.02.2015

It is always great to have the applications send alerts and create incidents or tickets when something goes wrong. MuleSoft provides ‘ServiceNow’ connector to establish connection between MuleSoft Applications and ServiceNow Database which seamlessly creates incidents, requests, assign requests to groups or people.

Given below are the steps to be followed for integrating "ServiceNow" with MuleSoft Applications:

1.Install the ServiceNow Connector in AnyPoint Studio (3.5 and above)
http://repository.mulesoft.org/connectors/releases/3.5.

2. Create a new AnyPoint Studio Project and Flow.

3. Before using the ServiceNow Connector in the Mule Flows, create a global element for ServiceNow configuration which can be reused in all other flows wherever a ticket/incident need to reported.

4. Configure the ServiceNow connector by providing the following information for the global element

    • User Name
    • Password
    • Service Instance URL

5. It is best to include the ServiceNow Connector in the Catch-Exception-Strategy to raise appropriate alerts based on the type of exceptions raised rather than in any part of the flow.

6. Although, the ServiceNow Connector can be placed in any flow, it is best to include the ServiceNow Connector in the Catch-Exception-Strategy to raise appropriate alerts based on the type of exceptions raised.

<servicenow:insert config-ref="ServiceNow" type="SYS_USER" doc:name="Insert System User">
<servicenow:insert-request ref="#[payload]"/>
</servicenow:insert>
<servicenow:insert config-ref="ServiceNow" type="SC_REQUEST" doc:name="Create a Request">
<servicenow:insert-request>
<servicenow:insert-request key="requestedFor">#[flowVars['UserName']]</servicenow:insert-request>
</servicenow:insert-request>
</servicenow:insert>
<set-variable variableName="RequestID" value="#[payload.number]" doc:name="Set Request Id"/>
<servicenow:insert config-ref="ServiceNow" type="SC_REQ_ITEM" doc:name="Assign a requested item with user">
<servicenow:insert-request>
<servicenow:insert-request key="request">#[flowVars['RequestID']]</servicenow:insert-request>
<servicenow:insert-request key="catItem">Jane Doe</servicenow:insert-request>
</servicenow:insert-request>
</servicenow:insert>

7. Run the Mule Application.

8. Check the ServiceNow Accounts as both, the user requested for and user who is assigned the request.

If you would like to find out more about how APIs could help you make the most out of your current infrastructure while enabling you to open your digital horizons, do give us a call at +44 (0)203 475 7980 or email us at marketing@whishworks.com

Other useful links:

APIs in the IoT

5 + 1 must have technologies for eCommerce success

Developing a successful API

Recent Posts