- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-18-2015 12:54 AM
Hello,
I'm trying to solve this and I can't get a solution: for a change request, if an user from approval group approve it, the workflow will continue with the next steps, but if the user reconsider his decision and Reject it, then the change will be set as 'rejected' and it will be closed.
I tried with a business rule on table "sysapproval_approver", on Change, if the State changes from 'Approved' to 'Rejected' and to use a script to identify the change number and set the approval state from 'Approved 1' to 'Rejected'.
myFunction();
function myFunction() {
var changeNo = current.sysapproval;
var gr = new GlideRecord('sysapproval_approver');
gr.addQuery('sysapproval',changeNo);
gr.query();
while (gr.next()) {
gr.sysapproval.approval ='Rejected';
}
gr.update();
}
Thank you in advance!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-19-2015 12:06 AM
I managed to solve this:
myFunction();
function myFunction() {
var changeNo = current.sysapproval.sys_id;
//gs.addInfoMessage('Change no: '+changeNo);
var gr = new GlideRecord('change_request');
var statul;
gr.addQuery('sys_id',changeNo);
gr.query();
while (gr.next()) {
// gs.addInfoMessage(gr.approval);
gr.approval ='Rejected';
gr.update();
// gs.addInfoMessage(gr.approval);
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-18-2015 01:45 AM
hi, the problem with this is that the workflow has moved on, so you will need to 'regress' the workflow as well, by either restarting or killing the workflow or having a workflow broadcast an event to make it rewind back.
So it's more work involved than simply reversing the 'approval' status field. I would ask how many times this would actually happen?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-18-2015 01:50 AM
Hi,
Thanks for you reply, the problem is not how many times it would happen, it is a SOX requirement so one time is enough
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-18-2015 01:53 AM
understood, in which case your going to have a look at also restarting the workflow and in effect reversing the change back into approval phase etc, there are quite a few things to think about, with a few different options.
you could put the change on hold, back to draft, as i say quite a few options and would advise discussion with the process owners.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-18-2015 01:52 AM
I should say that it's a bad way of implementing a change management system.. Without proper investigation and analysis, why should the change be approved and then rejected ? Isn't this a process issue rather than related to tool?