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

Kalyani Jangam1
Mega Sage
Mega Sage

Hi @Vaishnavi35 

Your BR code looking find, I also tried on my end and it is working as expected.

Just remove one condition stage changes to completed and try this. It will work.

Please check and let me know if it will work or not.

Hi Kalyani,

I have tried removing stage changes to completed condition. It still does not work.

Vaishnavi35_0-1687782649288.png

 

There is OOB BR for "Closed Incomplete" , is it overlapping?

Vaishnavi35_3-1687783011449.png

 

Should any "condition"(above the code) be added?

Vaishnavi35_2-1687782984654.png

 

Thanks,

Vaishnavi

Hi @Vaishnavi35 

Just try to deactivate OOB BR and try this. If it will work by deactivating OOB BR then you to balance two BR by orders. Please check once.

Hi,

I have tried deactivating the OOB one but it does not work. 

 

But I have observed something, I was submitting only one request repeatedly but when I submitted another request yesterday, the RITM state stayed as it is as "Closed Complete".

 

Workflow of the request that stayed as "Closed Complete"

Vaishnavi35_2-1687872147394.png

 

 

Workflow of the request that moved to Closed Incomplete automatically,

Vaishnavi35_3-1687872215226.png

 

 

If you can help me understand? I am literally confused.

 

Thanks & Regards,

Vaishnavi