Creating Requested Item from Business Rule, but Workflow won't link
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hello,
I've been trying to create a BR that creates a new request and linked requested item - I've been doing this with Gliderecord() and Insert().
Thing is, the designated workflow won't start nor even link to the RITM.
I've tried adding:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
@SSantacroce Yes you need to use Cart API, that is the recommended method to submit catalog item through script.
You should be able to submit catalog item (generating req and req item) following this article.
Please mark the answer correct/helpful accordingly.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi @SSantacroce ,
Yes you are correct you can use cart API here, please check below code,
(function executeRule(current, previous /*null when async*/ ) {
// Add your code here
var cart = new Cart();
var item = cart.addItem('f44fb27d93c8f2109305f520ed03d66d'); // Your Catalog item Sys ID
cart.setVariable(item, 'description', 'Test');
var rc = cart.placeOrder();
gs.info('Created Request: ' + rc.request_id + ', RITM: ' + rc.items[0]);
})(current, previous);
Please mark my answer correct and helpful if this works for you
Thanks and Regards,
Sarthak
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Additionally I tried this on my PDI please check below screenshots
BR
Once I update or create anything on Incident table RITM and Request got created
Please mark my answer correct and helpful if this works for you
Thanks and Regards,
Sarthak
