Request (sc_request) short description update as catalog name
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-15-2022 04:48 AM
My requirement was for a particular category items the request short description should be same as the catalog item name.
so i wrote a simple business rule on ritm below
Now i don't know what's wrong in it but i am getting rowcount 0 and as well the script doesn't enter inside the loop.
Regards,
Debasis
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-15-2022 05:17 AM
Instead of after try with async or increase the order to higher number.
Let me know if it works,
Thanks,
Murthy
Murthy
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-15-2022 05:27 AM
No it doesn't work
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-15-2022 05:52 AM
Hi,
Try below script it is working for me and used async business rule and insert.
(function executeRule(current, previous /*null when async*/ ) {
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);
if still it is going to if loop then you should need to check condition when it is triggering and whether it is triggered or not.
Hope you it helps you.
Please Mark ✅ Correct/helpful if applicable, Thanks!!
Regards
Pavankumar
ServiceNow Community MVP 2024.
Thanks,
Pavankumar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-15-2022 07:01 AM
Hi Pavan,
The business rule is triggering but its not going inside the if loop only.
Regards,
Debasis