The status goes back to draft, but all the old approvals are still out there and it doesn’t come back to Change Management to do the review approval.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-06-2022 12:03 AM
The status goes back to draft, but all the old approvals are still out there and it doesn’t come back to Change Management to do the review approval.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-08-2022 01:58 AM
I have used business rule below script.
current.state = '-1';
current.approval = 'not requested';
current.update();
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-08-2022 02:01 AM
Did you check the status of workflow for the same record, what is the status before moving it to Draft and after moving it Draft?
Regards,
Abhijit
ServiceNow MVP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-08-2022 02:26 AM
Ideally When you are moving the Change to Draft, you should make the Approval record which was generated to No Longer required.
This can be done using the script below . Please write a Before Update Business Rule on Change Request Table where you are trying to set the state of Change to Draft , update the same script to make the Approval as No Longer required as shown below:
Also making use of current.update() is not a good practice in a BR.
(function executeRule(current, previous /*null when async*/ ) {
// Add your code here
current.state = '-1';
current.approval = 'not requested';
updateApproval(current);
function updateApproval(current){
var gr = new GlideRecord('sysapproval_approver');
gr.addQuery('sysapproval',current.sys_id);
gr.query();
while(gr.next()){
gr.state = 'not_required';
gr.update();
}
}
})(current, previous);
Now once the change gets moved to Draft, may you can have a button UI Action , (there is one available OOB named as Request Approval) which you can use to generate the Approvals again when the change moves ahead from Draft state.
Hope this helps. Please mark the answer as correct/helpful based on impact.
Regards,
Shloke
Regards,
Shloke
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-08-2022 03:46 AM
It is working from all stages, but when the stage is review it is not working..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-08-2022 04:02 AM
Hi,
Just posting one liner saying it is not working will not help youo in getting this solved from a community member as we are not aware of how and what you have done so far and what is causing the issue here.
Please post complete details on what have you done so far so that I can help here.
Regards,
Shloke
Regards,
Shloke