- 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:55 AM
I don't have a clear answer. I'm a developer and for me it is only a task received from Management.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-18-2015 02:00 AM
We should not be blind in implementing anything just because it is possible to do so and should always advise back things to improve process wherever possible.. Can't this be handled by a supervisory approval of some kind ? It would be much easier plus would be much more robust approach, process wise too
- 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);
}
}