
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-23-2022 04:19 AM
hello friends,
we have created Flow to create one SC Task, but customers adding multiple Sctasks to the requests.
if they closed any SCtask, automatically it's related RITM got closed, it should not happend because when all SCTasks are completed then Related RITM/REQ should be closed,
i think it should be possible via BR, but not sure how I can 🙂
please help me how we can reproduce the issue.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-23-2022 06:27 AM
Hello,
Can you open the script tracer and then while you closing the sc task start it and then close the task this will give use the list of scripts running during that process. Also make sure your flow is inactive.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-23-2022 07:13 AM
if we removed the update conditions from Flow. it won't work . i have restored again then it's working ...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-25-2022 08:29 AM
Hello,
Yes that is because you are closing the RITM once the main sctask in the flow. Once you have created it let the RITM close through BR and not the flow remove that last step of closing the RITM if task is closed.
Please mark my answer as correct based on Impact.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-23-2022 04:33 AM
Refer to below thread and try utilizing the logic defined there in your flow.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-23-2022 05:11 AM
i tried it, but not working :):):)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-23-2022 05:52 AM
Hello,
Please write an after update BR on sc_task with the below code:-
var count=0;
var tasks = new GlideRecord('sc_task');
tasks.addQuery('request_item',current.request_item);
tasks.query();
var taskcount = tasks.getRowCount();
while(tasks.next())
{
if(tasks.state == 3)
{
count++
}
}
if(count == taskcount)
{
var rq = new GlideRecord('sc_req_item');
rq.addQuery('sys_id',current.request_item);
rq.query();
if(rq.next())
{
rq.state = 3;
rq.update();
}
}
Please mark my answer as correct based on Impact.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-23-2022 06:05 AM
it's not workig with above code,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-23-2022 06:09 AM
This means there is some other script or flow which is actually making the RITM to close complete. We will need to find that first. Also have you made your flow designer inactive while testing?