State and additonal comment not copying from sc_task to RITM for particular item

s_nandhini
Tera Contributor

Hi All,

 

As per the requirement State and Additional Comments are not copying from sc_task to RITM for certain item due to restriction of assignment group.

 

Sc_task contain restricted assignment group. So created a separate BR to copy the state from sc_task to RITM.It working fine in Lower environment but when moved to PROD. It is not working.

 

BR :

 

After (update) on sc_task

(function executeRule(current, previous /*null when async*/ ) {
if (current.state.changes()) {
var ritm = current.request_item.getRefRecord();
if (ritm) {
var xyz = gs.getProperty('xxm');
if (xyz) {
var itemList = xyz.split(',');
if (itemList.indexOf(current.cat_item.toString()) > -1) {
ritm.setWorkflow(false);
ritm.state = current.state;
ritm.update();
}
}
}
}
})(current, previous);

 

Please guide me if any issue in the code or how to copy state from restrcited sc_task to RITM.

 

1 REPLY 1

Ankur Bawiskar
Tera Patron

@s_nandhini 

so what debugging did you do?

did you add logs and see if it's entering the IF loop

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