Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

ServiceNow to Jira integration using business rule

Shalika
Tera Expert

I am new to integration in ServiceNow. 

I want to integrate SNow and Jira. The use case is such that whenever a incident is created in SNow, it should reflect in Jira. I have created the REST message Successfully. After that, what I need to do?

Should I write a business rule and if yes what would it be like 

12 REPLIES 12

What to write in script include and how to set up payload

Hi Shalika,

Inside script include:

functionName: function() {

var request = new sn_ws.RESTMessageV2();
request.setEndpoint('end point here');
request.setHttpMethod('POST'); //for create operation

//Eg. UserName="admin", Password="admin" for this code sample.
var user = 'admin';
var password = 'admin';
request.setBasicAuth(user, password);

//If having any requestBody
request.setRequestBody(JSON.stringify(requestBody)); //as per your requirement

request.setRequestHeader("Accept", "application/json");
var response = request.execute();
gs.log(response.getBody());

},

 

Feel free to mark correct, If I answered your query.
Will be helpful for future visitors looking for similar questions

Regards,
Nagaraj Tofin

How to create payload and what to write in it

Hi Shalika,

  • It depends on the requirement of other tool, how they need and in which format they need payload
  • Next is field mappings, there'll be field mappings from ServiceNow to integrating tool, based on that we need to map

Feel free to mark correct, If I answered your query.

Regards,
Nagaraj Tofin

Like I want that Short description and Number field in SNow should be mapped with summary field of Jira and description of both instances should be mapped. Then how should I proceed with writing the payload