- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-11-2021 01:58 AM
Hi Team,
I'm able to close the RITM when SCTASK is "closed complete". But, at the sametime if SCTASK is "closed incomplete" how to make RITM state "cancelled" using flow designer?
Regards,
Ash
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-11-2021 03:01 AM
Hi,
then do this in the BR
Condition: State Changes to Closed Incomplete
Script:
(function executeRule(current, previous /*null when async*/) {
// Add your code here
var ritm = current.request_item.getRefRecord()'
ritm.state = 'cancelled';
ritm.update();
})(current, previous);
Regards
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
02-11-2021 02:36 AM
Hi,
No
The above script will set RITM as Closed Complete when all the sc tasks for that RITM are completed i.e. task marked closed complete, closed incomplete, close cancelled
What is exactly required?
1) Usually we close RITM once all sc_tasks are closed whatever be the state of sc task
Regards
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
02-11-2021 02:42 AM
Hi Ankur,
Sorry, If my question was not correct!
I was able to do RITM "completed" when SCTASK is "closed completed" using flow designer as I mentioned before. but, If SCTASK is "closed Incomplete" then RITM needs to be updated as "Cancelled" this is not happening. can you please suggest for that?
Regards,
Ash
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-11-2021 03:01 AM
Hi,
then do this in the BR
Condition: State Changes to Closed Incomplete
Script:
(function executeRule(current, previous /*null when async*/) {
// Add your code here
var ritm = current.request_item.getRefRecord()'
ritm.state = 'cancelled';
ritm.update();
})(current, previous);
Regards
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
02-11-2021 03:33 AM
Thank you so much, Ankur!
Let me try this.
Regards,
Ash