Request description need to populated from RITM description

Rakesh11
Tera Contributor

I have written one BR to populate Request description from RITM description once RITM got created.
Below is the code:

var req = new GlideRecord ('sc_request');
req.addQuery('sys_id',current.request);
req.query();
if(req.next()){
req.description = current.description;
req.update();
}

 

But its not working. The same is working from Background script. Please help

7 REPLIES 7

Harish KM
Kilo Patron
Kilo Patron

Hi @Rakesh11 When is the BR triggered? also how are you triggering RITM? wf or flow designer?

Regards
Harish

Anand Kumar P
Giga Patron
Giga Patron

Hi @Rakesh11 ,

Create after insert Br on sc_req_item table with your script it should work else put some logs and check Br executing or not.
var req = new GlideRecord ('sc_request');
req.addQuery('sys_id',current.request);
req.query();
if(req.next()){
req.description = current.description;

req.setWorkFlow(false);
req.update();
}

Thanks,

Anand

 

Tried but no luck

Ankur Bawiskar
Tera Patron
Tera Patron

@Rakesh11 

your BR should be after insert on RITM

I hope you are populating RITM's description when RITM is getting created, because if that is empty then REQ description won't get updated

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader