Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

RITM state is moving to "Closed Incomplete" when actually saving it as "Closed Complete" - Issue

Vaishnavi35
Tera Guru

Hi,

When RITM is cancelled/closed Tasks should cancel or close . Approvals No longer required.

Vaishnavi35_1-1687777298783.png

 

Vaishnavi35_2-1687777322644.png

 

var catTask = new GlideRecord('sc_task');
catTask.addQuery('request_item', current.sys_id);
catTask.addQuery('active',true);
catTask.query();
while (catTask.next()) 
{
    catTask.state = 3;
    catTask.work_notes = "Closing Task as RITM is closed";
    catTask.update();
}

 

I have written a after BR, Code does not work.

The Tasks are getting closed just fine but the RITM state automatically moves to "Closed Incomplete" though I am marking it as Closed Complete , once the form reloads it moving to "closed incomplete". Not sure why.

 

HELP?

 

Thanks,

Vaishnavi

1 ACCEPTED SOLUTION

Use a branch activity in below workflow, branch activity basically divides the workflow into 2 paths. Since you are generating at the same time you should use branch and divide the flow.

Mehta_1-1687947022619.png

 

After that use join to convert to paths into one as below screenshot:

 

Mehta_2-1687947163618.png

 

Please mark it Correct if it resolves your query 

 

View solution in original post

5 REPLIES 5

Use a branch activity in below workflow, branch activity basically divides the workflow into 2 paths. Since you are generating at the same time you should use branch and divide the flow.

Mehta_1-1687947022619.png

 

After that use join to convert to paths into one as below screenshot:

 

Mehta_2-1687947163618.png

 

Please mark it Correct if it resolves your query