State and additonal comment not copying from sc_task to RITM for particular item
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
48m ago
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
43m ago
so what debugging did you do?
did you add logs and see if it's entering the IF loop
Ankur
✨ Certified Technical Architect || ✨ 10x ServiceNow MVP || ✨ ServiceNow Community Leader