How to cancel the RITM, when one of its task is close cancelled?

Sheenu Mejo
Mega Contributor

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.

1 ACCEPTED SOLUTION

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;

}
}

View solution in original post

14 REPLIES 14

Sebastian R_
Kilo Sage

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.

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?

Can you share a screenshot of your current workflow with us?

Sheenu Mejo
Mega Contributor

find_real_file.png