- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
6 hours ago
Dear Experts,
I have standard changes which processes the decommission of the servers but the tasks that are created is controlled which means that the preceding task is dependent on the previous task.. but when the first task is closed after the change is moved to implement before the next task is opened, and the state changes to Review but the tasks have not even been populated and there are other tasks pending as well. It is an out of the box behaviour, but how to prevent that. Please help!!!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
16m ago
I worked on the business rule it worked to held on the implement state
(function executeRule(current, previous /*null when async*/ ) {
var review_value = '0';
// Add your code here
var activeTask = new GlideRecord("change_task");
activeTask.addQuery("change_request", current.sys_id);
activeTask.addQuery("state", "NOT IN ", "3,4,7");
activeTask.query();
if (activeTask.hasNext()) {
current.setAbortAction(true);
return;
}
var activeFlow = new GlideRecord("sys_flow_context");
activeFlow.addQuery("source_record", current.sys_id);
activeFlow.addQuery("state", "IN", "IN_PROGRESS,WAITING,QUEUED");
activeFlow.query();
if (activeFlow.hasNext()) {
current.setAbortAction(true);
return;
}
current.state = review_value;
})(current, previous);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
6 hours ago
Please check the standard change flow mate
Regards
Dr Atul G. - Learn N Grow Together ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
******************************************************************************************
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
5 hours ago
Thank you @Dr Atul G- LNG we have designed it that way as I explained in my question.. and I also told that if the change does not find a task in a open state the standard change will move to review which is a OOB behaviour so I need to know what can be done to prevent the change to move to review until all the change task are complete.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
5 hours ago
Look here mate [Wait for condition]
https://www.youtube.com/watch?v=nYdhLaX2EOo&t=9
Regards
Dr Atul G. - Learn N Grow Together ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
******************************************************************************************
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 hours ago
I have wait for condition but wait for condition is something that is used on the state and the other task opens when the previous task is closed... see how this flow is
- CI update happens and the first task closed which triggers the second task once the first task is closed and then the consecutive tasks are open and wait for condition is applied on between tasks... but standard change thinks that once a task closes there are no other tasks and immediately moves the change state to review which i need to force stop at the first task and themn move to review when the last task is closed I am thinking of a business rule