- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-13-2022 05:58 AM
Hi Experts,
We have a requirement to update REQUEST short description same as Catalog Item name. I followed this Article but it updates both RITM and Request short description. We just want to update only REQUEST SD not RITM's. Can someone help me on this?
Thanks,
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-17-2022 08:21 AM
Hi @Community Alums ,
On RITM short description will get the catalog item short description not catalog item name.
So, if you are working on the catalog name to populate on Request short description use below script.
1. Create after business rule on RITM table and try this script.
(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.cat_item.name.toString();
req.update();
}
})(current, previous);
Catalog item: See below screen name and short description is different.
Result: RITM short description field is filled with catalog short description and Request short description is catalog name which populating through business rule.
ServiceNow Community MVP 2024.
Thanks,
Pavankumar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-13-2022 06:12 AM
Create an after insert BR on RITM table:
var req = new GlideRecord('sc_request');
req.get(current.request);
req.short_description = current.cat_item.name.toString();
req.update();
If you are using workflow you can use the same code in run script activity.
Raghav
MVP 2023
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-17-2022 04:31 AM
@Community Alums is your issue resolved.
Raghav
MVP 2023
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-13-2022 06:14 AM
That article that you linked looks fine. It will only update the Short Description for Requests.
OOTB, RITM short descriptions are automatically populated so that's something different.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-17-2022 08:21 AM
Hi @Community Alums ,
On RITM short description will get the catalog item short description not catalog item name.
So, if you are working on the catalog name to populate on Request short description use below script.
1. Create after business rule on RITM table and try this script.
(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.cat_item.name.toString();
req.update();
}
})(current, previous);
Catalog item: See below screen name and short description is different.
Result: RITM short description field is filled with catalog short description and Request short description is catalog name which populating through business rule.
ServiceNow Community MVP 2024.
Thanks,
Pavankumar