- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-12-2020 04:44 AM
Hello Team,
I have created new Catalog item and workflow. But here I need whenever I change state of SC Task then automatically RITM state has to be changed.
Thanks,
JRY
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-12-2020 05:18 AM
Hi,
Can you remove the condition for state changes to PendingValue?
BR: After Update
Condition: State changes && current.request_item.cat_item == 'yourCatalogItemSysId'
Script: whatever state changes on sc_task same to be updated in RITM
var gr = new GlideRecord('sc_req_item');
gr.get(current.request_item);
gr.state = current.state;
gr.update();
Mark ✅ Correct if this solves your issue and also mark 👍 Helpful if you find my response worthy based on the impact.
Thanks
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-12-2020 04:50 AM
Hi,
this you can do using after update BR on sc_task table; workflow is not proper approach for this
BR: After Update
Condition: State changes && current.request_item.cat_item == 'yourCatalogItemSysId'
Script:
// do what is required
Mark ✅ Correct if this solves your issue and also mark 👍 Helpful if you find my response worthy based on the impact.
Thanks
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-12-2020 05:04 AM
Sorry Ankur, I didn't get you. Can you explain me with the script because here if change state on catalog task to "pending" then on RITM state field has to change to "pending" or state changes to closed incomplete then ritm state has to be changes to closed incomplete.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-12-2020 05:06 AM
I have tried below script but it's changing for specific state itself but I need it for all states
Condition: current.state.changesTo("PendingValue")
Script:
var gr = new GlideRecord('sc_req_item');
gr.get(current.request_item);
gr.state = "PendingValue";
gr.update();
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-12-2020 05:18 AM
Hi,
Can you remove the condition for state changes to PendingValue?
BR: After Update
Condition: State changes && current.request_item.cat_item == 'yourCatalogItemSysId'
Script: whatever state changes on sc_task same to be updated in RITM
var gr = new GlideRecord('sc_req_item');
gr.get(current.request_item);
gr.state = current.state;
gr.update();
Mark ✅ Correct if this solves your issue and also mark 👍 Helpful if you find my response worthy based on the impact.
Thanks
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader