- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-11-2020 06:53 AM
I need to close the whole RITM and tasks when one of its tasks assigned to a specific group is close canceled.
Please put up your suggestions here.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-13-2020 07:57 AM
Thanks a lot for your replies and responses Brad. As you said, yeah it worked for me. I used the following script in my "wait for condition" activity.
answer = true;
workflow.scratchpad.flag = false;
var gr = new GlideRecord('sc_task');
gr.addQuery('request_item', current.sys_id);
gr.query();
var state;
var group;
while (gr.next()) {
state = gr.getValue('state');
group = gr.getDisplayValue('assignment_group');
if (group.startsWith("HR") && (state == 7)) {
workflow.scratchpad.flag = true;
answer = true;
break;
} else if (!((state == 3) || (state == 4) || (state == 7))) {
answer = false;
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-11-2020 06:58 AM
You can do it within the catalog item workflow/flow.
After the task creation you can wait until it is closed and check the task state. If it is canceled you can cancel the RITM accordingly.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-11-2020 07:05 AM
Hi Sebastian,
I tried canceling it from the workflow, also have put a wait for condition activity.
But then the script is checking for only one task. I need it to check for all tasks and if anyone of its task is close canceled, then it should close the whole ritm.
Can you please provide the script for this?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-11-2020 07:47 AM
Can you share a screenshot of your current workflow with us?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-11-2020 07:49 AM