- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-26-2023 04:02 AM
Hi,
When RITM is cancelled/closed Tasks should cancel or close . Approvals No longer required.
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
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-28-2023 03:13 AM
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.
After that use join to convert to paths into one as below screenshot:
Please mark it Correct if it resolves your query
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-26-2023 04:30 AM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-26-2023 05:37 AM
Hi Kalyani,
I have tried removing stage changes to completed condition. It still does not work.
There is OOB BR for "Closed Incomplete" , is it overlapping?
Should any "condition"(above the code) be added?
Thanks,
Vaishnavi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-26-2023 06:05 AM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-27-2023 06:20 AM - edited 06-27-2023 06:23 AM
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"
Workflow of the request that moved to Closed Incomplete automatically,
If you can help me understand? I am literally confused.
Thanks & Regards,
Vaishnavi