I need to update the RITM approval state to approved when request approval state to approved.

megana1
Kilo Contributor

 I need to update the RITM approval state to approved when request approval state to approved.

To implement this i wrote the after BR update on Request table .

Below is the script 

var gr = new GlideRecord("sc_req_item");
gr.addQuery("request", current.sys_id);
gr.query();

if (gr.next()) {
current.approval ='approved';
current.update();

 

Please let me know if any issues on this which i  need to correct .

3 REPLIES 3

Vijayata Manche
Kilo Expert

After update business rule on Request table

condition: approval changes to Approved

script:

var gr = new GlideRecord("sc_req_item");
gr.addQuery("request", current.sys_id);
gr.query();

if (gr.next()) {
gr.approval ='approved';
gr.update();

}

 

Thanks

VM1104

 

megana1
Kilo Contributor

Hi,

Still not working.

Regards,

Megana

ryan_pope
Mega Guru

Why not use a Set Value activity on the RITM workflow. The RITM WF should get held up until the REQ WF is complete, which would imply the approval was successful. So, I would just use a Set Values activity to "Approval" is "Approved".