The CreatorCon Call for Content is officially open! Get started here.

How to replace these hard coded values with current values?

sriram9
Giga Contributor

Dear experts,

Here is my BR in my second servicenow instance, i wanted to replace the hard coded values(highlighted) of the code, so that , it takes the newly created incident's parameters(like current.short_description, current.impact etc) and transfers that to instance 1

request.setBasicAuth(user,password);
request.setRequestHeader("Accept","application/json");
request.setRequestHeader('Content-Type','application/json');

request.setRequestBody("{\"short_description\":\"created on 24-8-2018\",\"impact\":\"1\",\"urgency\":\"1\",\"description\":\"connected two servicenow instances and trying to pass data\"}");

var response = request.execute();
gs.log(response.getBody());
var responseBody = response.getBody();
var httpStatus = response.getStatusCode();
}

 

1 ACCEPTED SOLUTION

Chuck Tomasi
Tera Patron

BTW, I spent almost the entire session on today's community live stream on this same example. You can find it on YouTube on the Community Live stream 2018-08-27 show.

View solution in original post

7 REPLIES 7

Omkar Mone
Mega Sage

Hi 

You can get it from preview script.

 

Mark correct if it helps.

 

Regards,

Omkar Mone

www.dxsherpa.com

Chuck Tomasi
Tera Patron

BTW, I spent almost the entire session on today's community live stream on this same example. You can find it on YouTube on the Community Live stream 2018-08-27 show.

Thank you!  I just got lucky to get such a detailed answer.