- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-05-2023 05:10 AM - edited ‎06-23-2023 04:17 AM
Hi,
1. When Tasks are closed, RITM is not getting closed. (RITM should close once the Catalog Task is closed)
2. When RITM is cancelled/closed Tasks should cancel or close . Approvals No longer required.
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.
3. Once the RITM is closed REQ is not getting closed and still "Active".
Please help me fix this issue!
Thanks,
Vaishnavi
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-30-2023 04:20 AM
This happening because your workflow is attached to the RITM and it is still going to proceed with the flow. There is only one functionality which cancel the workflow upon ritm cancelation.
If you close complete the RITM and there is still few activities in the workflow to be executed. it will execute that.
Make sure to close RITM upon completion of Workflow. you can do one thing before this activity. You can put a if statement and check if RITM is closed complete or not and according proceed the flow.
Please mark it Correct if it resolves your query.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-14-2023 06:08 AM
You do not need to run the above business rule when state changes to closed incomplete as we have an oob business rule which changes the task to closed incomplete when request or ritm goes to cancel stage
"Close Tasks Due to Cancellations" is the business rule.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-15-2023 07:14 AM - edited ‎06-15-2023 07:44 AM
Hi,
I had removed that earlier itself.
Here the issue is,
even when I moved the state to "Closed Complete", its updating as " Closed Incomplete".
Example ,
1. RITM - Closed Incomplete (When I try to move the RITM state to Closed Complete , it automatically moves to Closed Incomplete")
Task 1 - "Closed Complete"
Task 2 - "Closed Incomplete"
Task 3 - "Closed Incomplete"
2.
RITM - Closed Incomplete (When I try to move the RITM state to Closed Incomplete , it stays as it is and all the task states to Closed Incomplete even for the closed records")
Task 1 - "Closed Incomplete"
Task 2 - "Closed Incomplete"
Task 3 - "Closed Incomplete"
This is the issue. I think the code needs to be corrected.
(function executeRule(current, previous /*null when async*/) {
// Add your code here
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();
}
})(current, previous);
If you can please help me on that?
Thanks for all the help.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-16-2023 12:35 AM
There could be another business rule which is making the above issue, This is because the script above is updating value as 3 for state which is closed complete and where as closed in complete has a value of 4.
You can make the above business rule as active false and then you can test. that can give you a clear picture.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-19-2023 06:18 AM - edited ‎06-19-2023 09:59 AM
Hi,
Business rules where script contains "state".
Not sure where is the issue. I have tried disabling the business rule and submitting the request.
I have moved the RITM to Closed Complete. Nothing works.
But when I moved RITM to "Closed Incomplete" , all the tasks move to Closed Incomplete irrespective of the old/active tasks.
I have enabled and tested again,
The RITM state is automatically moving to "Closed Incomplete" but the all tasks are moving to closed complete.
Should we write any condition???
Like current.stage!='Request Cancelled' etc.,
// Add your code here
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();
}
Help?
Thanks,
Vaishnavi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-21-2023 12:40 AM
Depending on your use cases you can add multiple if statements and populated/update the value of states accordingly.