
- 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 06:15 AM
I'm not sure about other Scripts running or not.
flow still active state ... just now i have tried it but no luck .

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-23-2022 06:17 AM
want to inform to you.
first SC Task will automatically generated when request created.
remain SC tasks manual i have added under request item
- 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:12 AM
Saurav you are right.. other scripts are running same time :):)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-23-2022 06:17 AM
I can notice that in your Flow designer only in Step 5 and 6, you can Making RITM as Completed if your SCTASK is Closed Complete. Please remove it from your Flow.
Now to close RITM when all related SC Task are closed, you can right below After Update Business Rule:
var sctask= new GlideRecord('sc_task');
sctask.addQuery('request_item', current.request_item);
sctask.addEncodedQuery("stateIN-5,1,2");
sctask.query();
if(!sctask.hasNext())
{
var ritm = new GlideRecord('sc_req_item');
ritm.addQuery('sys_id', current.request_item);
ritm.query();
if(ritm.next())
{
rq.state = 3;
rq.update();
}
}
Thanks
Anubhav Ritolia
ServiceNow Rising Star 2023