checking if change tasks have been approved before requesting approval for a change request
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-03-2016 02:03 PM
I am trying to write a business rule to check all change tickets to make sure that they have been approved before a change can be placed into pending or "requested for approval"". my script is not working for some reason and I would love if the community would help me out. Thanks in advance
function onBefore(current, previous) {
checkChildTasks();
function checkChildTasks() {
var grChild = new GlideRecord("change_task");
grChild.addQuery('change_request', current.sys_id);
grChild.addQuery('Approval',"CONTAINS","approved");
grChild.query();
while(grChild.next()){
if (grChild.result == "approved" || grChild.result == "skipped")
answer = true;
else{
answer = false;
return;
}
}
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-04-2016 10:01 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-04-2016 10:04 AM
Is this a before business rule and did you check the insert and update checkboxes? Which release are you on?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-04-2016 11:18 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-07-2019 08:31 AM
Hi Donatello, were you able to find a solution for this requirement?
Thanks,
Akshya