Async business rule sometime working and sometimes not
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-14-2022 12:31 AM
Hi, I have a simple requirement we need to copy the name of the catalog to req short description we cant change all the flow to get this done so i have created an async business rule on the req item table but its sometimes working and sometimes doesn't.
Above business rule script:
(function executeRule(current, previous /*null when async*/) {
// Add your code here
gs.log("frombrscript");
var req = new GlideRecord('sc_request');
req.addQuery('sys_id', current.request);
req.query();
if (req.next()) {
req.short_description = current.getDisplayValue('cat_item');
req.update();
}
})(current, previous);
@Ankur Bawiskar Can you please suggest why this doesnt work everytime it works sometimes only.
Regards,
Debasis
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-14-2022 02:36 AM
Hi,
check this
if Flow Designer support for the Service Catalog plugin (com.glideapp.servicecatalog.flow_designer) plugin is activated then it should show
Flow designer does not trigger on Request Item [sc_req_item] and Catalog Task [sc_task]
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-14-2022 02:57 AM
I see this plugin is already activated but in table field I don't see sc_req_item table is present.
Regards,
Debasis
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-14-2022 03:04 AM
are you in scoped app? if global scope then it should show
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-14-2022 03:57 AM
@Ankur Bawiskar I am in global scope sc_request table is showing but sc_req_item is not showing can it be directly done on request table itself?
Regards,
Debasis
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-14-2022 04:33 AM
it can be done
You need to use Lookup Record on RITM table to find the RITM and then get the item name
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader