REST Incident eBonding with attachments
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-25-2020 09:28 AM
I need to do incident eBonding with another ServiceNow instance, so on my business rule I post the incident without attachment.. I get response with the sysID and I need to later use for my Attachment API, because in the Attachment API you need to specify the sysID of the record that has to be attached, hows is this achievable technically? Does it mean that I need to pass the sysID from my response to another post and call the Attachment API from Instance B?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-26-2020 09:13 AM
Hello,
yes, this is exactly what you need to do. Once you have received the response with sys_id, check if there are attachments to the ticket in your instance.
If there are attached files, you iterate over them, until you have sent all files to destination system
var grAttachment = new GlideRecord('sys_attachment');
grAttachment.addQuery('table_sys_id', current.sys_id);
grAttachment.query();
while(grAttachment.next())
{
createAttach ( current, grAttachment);
}
In createAttach function you will generate a call to the other ServiceNow instance.
Let me know if you have any questions.
Best regards,
Boyan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-26-2020 09:15 AM
Are you using the ebonding spoke or doing via code?
Thanks
Sudhanshu

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-26-2020 09:54 PM
The OOTB Ebonding spoke doesn't send through the attachment associated with the ticket on either side. I believe you will need to add your own REST step.
This may help: https://community.servicenow.com/community?id=community_article&sys_id=5d9cd5addb9d0894d82ffb2439961...
Johnny
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-01-2023 05:46 AM
I have created my own rest step and the incident ticket is getting attached but I want to a change a field's value which is being sent to the instance B from instance A. But at the same time I don't want to change anything in the instance A. what should I do ?