- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi,
I created rest message and created end point and http methods, but the incident is not getting created in the target. Kindly help.
{
"caller_id":"${caller}",
"short_description":"${sd}",
"description":"${desc}",
"contact_type":"${ct}"
}
(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.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Have a look here.
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.
Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]
****************************************************************************************************************
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Thank You, my stupid mistake
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Refer below link for step by step instructions
ServiceNow to ServiceNow Integration using REST API and PUSH and PUT methods with Business Rule
You can also explore on Ebonding Spoke with less scripting
Refer the below link which has the approach with example shared by me.
Integration hub ebonding spoke
💡 If my response helped, please mark it as correct ✅ and close the thread 🔒— this helps future readers find the solution faster! 🙏
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader