- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-08-2018 11:22 AM
Hello Everyone,
We are integrating ServiceNow through REST.
1) We are sending our incident number to that tool using rest with post method and we are getting a task number from them in response.
2) I am capturing that task id in a field on incident form.
3) Now, I have another web service where I need to send some fields from same incident form using POST method, here they I want to send these taskid in http header ( ex: content-type - taskid).
4) I am currently trying to trigger using business rule and stuck hear on http header.
Can anyone help me with this???
Thanks,
RK1229
Solved! Go to Solution.
- Labels:
-
Integrations
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-08-2018 11:32 AM
Yeah, Arka is right, you can use something like this
r.setRequestHeader("hearder name",current.taskid);
you can use this in your script.
Regards<
Raghava
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-08-2018 11:25 AM
Hello RK,
If I understand correctly you want to use task id into one of your headers???
Regards,
Raghava
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-08-2018 11:26 AM
Have you tried the setRequestHeader parameter in business rule?
See the Below link. It will help
RESTMessageV2 - setRequestHeader(String name, String value)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-08-2018 11:42 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-08-2018 11:45 AM
Yes you could do that
var a=current.task_id; //field name where you are storing the task id
var sm = new sn_ws.RESTMessageV2("<your rest message name>","<operation>");
sm.setRequestHeader("task_id",a);