- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-22-2020 03:33 AM
Hi Community,
I have a business rule attached that work for updating and creating incident tickets over API to external 3rd party, but I am now trying to add to the business rule the capture and sending of attachments, whenever there is an attachment.
I successful created a test update and get and post of the attachments from Postman (with help of the document that Muhammad had previously sent through "HackLab") however was unsure of how to fit the script and which bits of script to add from the document
, however I am not sure of the JSON script i should be writing to be able get and send the attachments over externally from the business rule.
Just need to add to the business rule (not take away anything because it works fine for creating / updating of incidents)
Any help much appreciated
Thanks
Steve
Solved! Go to Solution.
- Labels:
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-25-2020 04:39 AM
I am glad that you got it working.
Just for your information, In case if you need to hit different endpoints based on Insert or update then you can create a script include reusable utility and from BR you can use
current.insert() & current.update() methods to check the operation and based on that you can call your script include passing in dynamic data. I hope this will help you in the future.
Have a nice day 🙂
Thanks & Regards,
Sharjeel
Muhammad
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-25-2020 01:26 AM
Sharjeel,
Tested this and it didnt work, although I know why. The external endpoints are different for each type of update. ie. different for create of ticket, also different for update attachments and so on.
So question is how do we add a different endpoint into the business rule for create ticket with attachment with is different from create ticket without attachment?
Many thanks
Steve
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-25-2020 04:16 AM
Sharjeel,
Please disregard my last message, the endpoints have changed, hence all good.
It will be a while before we can test properly, but many thanks for all your assistance on this.
Kind regards
Steve

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-25-2020 04:39 AM
I am glad that you got it working.
Just for your information, In case if you need to hit different endpoints based on Insert or update then you can create a script include reusable utility and from BR you can use
current.insert() & current.update() methods to check the operation and based on that you can call your script include passing in dynamic data. I hope this will help you in the future.
Have a nice day 🙂
Thanks & Regards,
Sharjeel
Muhammad
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-25-2020 09:39 AM
Sharjeel,
Thank you again, and thanks for the latest info, you have been a great help.
Many thanks
Steve
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-26-2020 03:23 AM
Sharjeel,
Just to let you know that the script works perfectly end to end, however it only works when there is an actual attachment added, otherwise it will fail, hence we are currently looking at putting something into the script like an IF attachment exists run, else if attachment doesn't exist then abort the attachment script.
Thanks
Steve