Image
Servicenow Integration with Azure DevOps

Servicenow Integration with Azure DevOps

Jasmine Rego
September 15, 2021

Introduction

Azure DevOps is a platform used to collaborate between development and operations, resulting in effective and efficient software delivery. The engineers working on ServiceNow Incident/Problem may need to create a bug in ADO for the engineering team to work on this.

Problem Statement

This results in switching between platforms and communicating in multiple channels to have information regarding both platforms may lead to misinformation, cost, time, and manpower and therefore inefficient delivery.

The Impact on the Business is:

  • Improper Management of Information
  • Errors Caused due to Duplication of Updates in Multiple Applications
  • The Effort needed to update, manage and track activities in different instances
  • The Effort involved resulting in Time and Manpower which indirectly contributes to the Operational Cost

Solution Consideration

To address this issue and have an effective and efficient communication between the tool, this integration is introduced.

The Servicenow Integration with ADO helps in creating work items from Servicenow and update the fields in both systems in a bi-directional flow to have the support Engineers and Engineering team to work together effectively.

What is a work item?

Work items are records in Azure DevOps used to track anything you need to track. Each work item represents an object stored in the work item data store. Each work item is based on a work item type (Bug, Epic, Task etc) and is assigned an identifier which is unique within an organization or project collection.

The REST Integration process followed in this case, we use the work item type Bug for a problem in Servicenow and the relationship is an incident to problem to ADO, in that order.

As the flow indicates above, a problem record is created for an incident. ADO work item is then created from problem using a UI action. Any relationship of ADO work item with ServiceNow is directly linked to the problem to have one to one relationship.

APIs used in the REST Integration

Action Method API
Create Work Item POST https://dev.azure.com/{organization}/{projectY/_apis/wit/workitems/${type)?api-version=5.1
Get Work Item GET https://dev.azure.com/forganization}/{project}/_apis/wit/workitems/{id}?api-version=5.1
Get batch of Workitems POST https://dev.azure.com/{organization}/{project}/_apis/wit/workitemsbatch?api-version=5.1
Modify Work Item PATCH https://dev.azure.com/{organization}/{project}/_apis/wit/workitems/{id}?api-version=5.1
Get Comments GET https://dev.azure.com/{organization}/{project}/_apis/wit/workltems/{workltemldy comments/{commentid}?api-version=5.1-preview.3
Get field values(List of processes) GET https://dev.azure.com/{organization}/_apis/work/processes/lists/{fiekdvalues}
Add Attachment POST https://dev.azure.com/{organization}/{project}/_apis/wit/attachments/{filename)?api-version=5.0

Processes in Servicenow-ADO Integration

Creation of Work Item:

As the relationship created is Problem to ADO, work item is generated from a problem record using UI action.

This will open a wizard with all the fields that are required to create a work item. The fields on the wizard will be mapped to the ADO work item fields and Record Generator script written to push the fields and Create work item with the API given above.

Once the work item is created, a work item ID is generated. This can be used to create a URL that will direct to the work item on ADO platform.

Note: It is necessary to match the values in the ADO and SNOW to create the work item without any error.

Bi- Directional sync between ADO and ServiceNow

Once the work item is created, certain fields are synced between the platforms to have a real time and accurate data to help the engineers get an update on it.

Servicenow to ADO

  • To sync fields from Servicenow to ADO, business rules written on update and change of the fields specified and pushed onto the work item using API Modify Work Item as stated above in the table.
  • To add an attachment from Servicenow to ADO business rule is used with the API Add Attachment to send various types of files on insert on the attachment table for a problem record

ADO to ServiceNow

  • To bring in the updates, a scheduled job is set up every 5- 10 minute based on the requirement. This scheduled job will pick a batch of 200 ADO IDs from Servicenow and use API Get Batch of Work items to bring in all the updates for the fields necessary.
    Once the updates are brought in, it is added in a staging table from which it is mapped to the problem table with the respective fields.
  • Comments are also synced from ADO to Servicenow using the same scheduled job but with API Get Comments and added to a staging table from which updated in the journal entry thereafter.

Note:

  • A JSON file is created to determine which fields are to be created, synced and domain of ADO work item.
  • Properties are set to define domains (Project) of the ADO work item
  • A script include is created to hold all the functions that are called to create, modify, match values etc.
    Ex: To update commercial priority onto ADO a business rule is written on update which would call a function from the script include that calls the Modify Work Item API. Also call the convert commercial priority function to convert values to match that from ADO.

Benefits

The Integration results in seamless connectivity between Azure and ServiceNow reducing the Effort, Time, Cost and Manpower along with increasing the efficiency as there is less room for errors and manual activities.

Recommended Best Practices

  • Keep the number of ADO IDs of a batch less to avoid issues in scheduled job execution
  • Make sure the values of a field from both platforms match exactly
  • Centralise as much functionality as possible in one platform
  • Be cautious of looping when integrating (Bi-directional)

Conclusion

This integration helps in creating a work item directly without switching between platforms and support engineers can update information from ServiceNow and Engineering team can update information on ADO and both parties will be on the same page resulting in faster and quicker resolution.

About the Author

ServiceNow to ADO integration by Jasmine Rego
Jasmine Raynah Rego
Senior Software Engineer : 6 years
Servicenow developer who has worked in ITSM extensively and also CSM

Add New Comment

Restricted HTML

  • Allowed HTML tags: <a href hreflang> <em> <strong> <cite> <blockquote cite> <code> <ul type> <ol start type> <li> <dl> <dt> <dd> <h2 id> <h3 id> <h4 id> <h5 id> <h6 id>
  • Lines and paragraphs break automatically.
  • Web page addresses and email addresses turn into links automatically.