if SC task sill open - request Item closed

Kishor Mudhili
Giga Guru

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. 

 

KishorMudhili_0-1669205919796.png

 

3 ACCEPTED SOLUTIONS

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.

 

Saurav11_0-1669213630476.png

 

View solution in original post

if we removed the update conditions from Flow. it won't work . i have restored again then it's working ...

View solution in original post

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.

View solution in original post

18 REPLIES 18

Muhammad Khan
Mega Sage
Mega Sage

Refer to below thread and try utilizing the logic defined there in your flow.

How can we check if all the catalog tasks are closed in flow designer using Wait for condition actio... 

i tried it, but not working :):):)

Saurav11
Kilo Patron
Kilo Patron

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.

it's not workig with above code,

 

KishorMudhili_0-1669212304739.png

 

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?