How to add and turn the ServiceNow ticketID to a hyperlink using REST call
search cancel

How to add and turn the ServiceNow ticketID to a hyperlink using REST call

book

Article ID: 138962

calendar_today

Updated On:

Products

CA Service Operations Insight (SOI)

Issue/Introduction

Using SOI REST call, the ticket id number can be added to an alert, but how can I add the ticket id number and turn it into a hyperlink?

Environment

Release : 4.2

Component : Service Operations Insight (SOI) Manager

Resolution

To create a hyperlink for the ticket you'll have to provide "ticketId" and "ticketUrl" values. Each of these values has to be passed on to SOI in a certain format. 

"ticketId" should have the format <incident number>.

"ticketUrl" should have the format "https://<ServiceNow Instance>/nav_to.do?uri=incident.do?sys_id=<sys_id> value

 Note:

To get the sys_id of the incident number you'll have to look in to xml content for the ticket in ServiceNow. The Content-Type of your PUT request should be application/vnd.ca.soi.api.v2+xml (same as the GET request)

Here is an example of the PUT REST call to add a ticketID with hyperlink:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>

<alertDefinition>

    <acknowledged>false</acknowledged>

    <ticketId>INC0010003</ticketId>

    <assigned></assigned>

    <exempt>false</exempt>

    <userAttributes>

        <userAttribute1></userAttribute1>

        <userAttribute2></userAttribute2>

        <userAttribute3></userAttribute3>

        <userAttribute4></userAttribute4>

        <userAttribute5></userAttribute5>

        <userAttribute6></userAttribute6>

        <userAttribute7></userAttribute7>

        <userAttribute8></userAttribute8>

        <userAttribute9></userAttribute9>

        <userAttribute10></userAttribute10>

    </userAttributes>

    <ticketUrl>https://example.service-now.com/nav_to.do?uri=incident.do?sys_id=examplesis_id</ticketUrl>

</alertDefinition>


Note:

The sys_id should be replaced with the sys id of your incident number and you need to replace "example.service-now.com" instance with your ServiceNow instance name.