Set RITM to same state as Catalog task

Cat
Mega Guru

Hi All!

 

I've got one form, where the team have requested that the RITM shows as Open state until the task is assigned, at which point it changes to Work in Progress State. I have done this, but now, when the task is closed, the RITM stays as work in progress rather than Closed Complete.

I did this using a business rule.

Does anyone know how I can fix it so that the RITM shows as Closed Complete once the sc_task is closed?

 

This is my business rule:

Cat_0-1730303089992.pngCat_1-1730303117841.png

and the advanced script is the below:

 

 

 

(function executeRule(current, previous /*null when async*/) {

var getritm=new GlideRecord('sc_req_item');
getritm.addQuery('sys_id',current.request_item);
getritm.query();
if(getritm.next())
{
getritm.state=current.state;
getritm.update();
}

})(current, previous);

 

Thanks 🙂
0 REPLIES 0