Request (sc_request) short description update as catalog name

Debasis Pati1
Tera Contributor

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

find_real_file.pngfind_real_file.png

 

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

10 REPLIES 10

Murthy Ch
Giga Sage

@Debasis Pati 

Instead of after try with async or increase the order to higher number.

 

Let me know if it works,

 

Thanks,

Murthy

Thanks,
Murthy

No it doesn't work 

Pavankumar_1
Mega Patron

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

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

Hi Pavan,

The business rule is triggering but its not going inside the if loop only.

 

Regards,

Debasis