Short Description of Request same as Cat Item name

Community Alums
Not applicable

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,

1 ACCEPTED SOLUTION

Pavankumar_1
Mega Patron

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.

Screenshot (523).png

 

Result: RITM short description field is filled with catalog short description and Request short description is catalog name which populating through business rule.

Screenshot (524).png

If it helps please click Accept as Solution/hit the Thumb Icon.
ServiceNow Community MVP 2024.
Thanks,
Pavankumar

View solution in original post

6 REPLIES 6

Community Alums
Not applicable

Hi,

I have tried this but no luck. We nearly have 80 cat items, so we want to update every REQUEST short description same as Cat Item name.  I'm trying to do it on REQUEST workflow so that it will applicable for all items.

Zstromsodt
Tera Contributor

One thing to add to this conversation is using the Flow to add this information. In our case, we just copy our flow template and customize it for the catalog item but you could update your main flow to do this for all catalog items as well.