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.

Create incident in target Integrations

ServiceNow Use6
Tera Guru

Hi,

I created rest message and created end point and http methods, but the incident is not getting created in the target. Kindly help.

 

1.jpg

 

2.jpg

 

3.jpg

 

4.jpg

 

{
"caller_id":"${caller}",
"short_description":"${sd}",
"description":"${desc}",
"contact_type":"${ct}"
}

 

5.jpg

 

6.jpg

 

(function executeRule(current, previous /*null when async*/) {

	gs.log('Business Rule is running');

	var rest = sn_ws.RESTMessageV2('dev199583Instance', 'dev199583Outbound');
	rest.setStringParameter('caller', current.caller_id);
	rest.setStringParameter('sd', current.short_description);
	rest.setStringParameter('desc', current.description);
	rest.setStringParameter('ct', current.contact_type);
	
	gs.log("Business Rule ran");

})(current, previous);

 

Regards

Suman P.

1 ACCEPTED SOLUTION

Laveena-Agarwal
Kilo Sage

Hi @ServiceNow Use6 

 

Your Business rule(BR) script doesn't have a code to execute the rest message. On HTTP method you will find the related link "Preview Script Usage" - from here you can copy the script and modify it in your BR if required.

 

There is another easy approach to do this integration - Use Rest API explorer on your source instance , directly build the json and sent the details to target.

View solution in original post

5 REPLIES 5

@ServiceNow Use6 

Thank you for marking my response as helpful.

As per new community feature you can mark multiple responses as correct.

💡 If my response helped, please mark it as correct as well so that this helps future readers find the solution faster! 🙏

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader