How to trigger a Rest API (Post) call, When users clicks 'Save as a draft' button on service catalog
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 hours ago
Hi All,
Currently I am working on a requirement where a catalog item is being initiated via Jira. My task is to push back the details of the draft version to Jira when anyone clicks on 'Save as a draft' button. So that for the same record no one should initiate the catalog item.
How can I modify the save as draft button and that too for one particular catalog item.
Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 hours ago
Option 1: Business Rule (on sc_cart_item or sc_req_item)
Add after insert/update BR on sc_cart_item.
Condition: current.cat_item == "<sys_id of your catalog item>" and state == 'draft'.
Action: Call your Script Include that posts to Jira REST.
Option 2: Create a Flow with:
Trigger: Record created/updated → Table = sc_cart_item (or sc_req_item depending on where drafts are stored).
Condition: Catalog Item == X AND Stage == draft.
Action: Outbound REST action → POST to Jira.
In my views don’t modify OOTB "Save as Draft" button directly. Instead, go with Business Rule or Flow Designer depending on whether you prefers scripted or config-driven solutions.
Thanks & Regards,
Muhammad Iftikhar
If my response helped, please mark it as the accepted solution so others can benefit as well.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 hours ago
Thank you @M Iftikhar , I will try this approach.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
an hour ago
whenever Save as draft is clicked data gets inserted into backend table (sc_cart_item), but remember it stays there for small amount of time.
you can have after insert BR on that table which triggers for your catalog item
when you open that record it shows the variables saved in draft version
OR
you can customize that button and handle your logic and it will require some heavy customization in that widget
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
an hour ago
Hi @Ankur Bawiskar , Thank you for the reply. I will try the approach suggested by you.