Change request cannot be moved from access to authorize
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-13-2022 02:33 AM
Hi Experts,
Need you help on the below.
A change request cannot be moved from Assess to Authorize state when any associated CTASKS are unassigned to any individual. If in case the requester clicks on Request Approval without assigning the CTASK to an individual, it should throw out a message in Dialog box
Note : Assess to Authorize happens when the change is clicked on Request approval
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-13-2022 05:50 AM
try below:
var ctask = new GlideRecord('change_request');
ctask.addQuery('change_request',current.sys_id);
ctask.addEncodedQuery('assigned_toISEMPTY');
ctask.query();
if(ctask.getRowCount()>0)
{
current.setAbortAction(true);
}
else{
current.state=-3
}
Raghav
MVP 2023
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-13-2022 10:05 PM
@Rajesh77 did this worked for you?
Raghav
MVP 2023

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-13-2022 03:17 AM
Hello,
Try below before business rule on 'change_request' table , condition is State changes to 'Authorize'
var ctask = new GlideRecord('change_task');
ctask.addQuery('change_request',current.sys_id);
ctask.addQuery('assigned_to' , '');
ctask.query();
if(ctask.hasNext())
{
gs.addInfoMessage('Change cannot be moved to Authorize state as there are CTASKS which are not assigned to anyone');
current.setAbortAction(true);
}
Regards,
Musab
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-13-2022 04:11 AM
this is the one i tried
var ctask = new GlideRecord('change_request');
ctask.addQuery('change_request',current.sys_id);
ctask.addQuery('assigned_to' , '');
ctask.query();
if(ctask.getRowCount()>0)
{
gs.addErrorMessage(" Make sure to assign the CTASK's to the respective Assignee before clicking on Request Approval.");
current.setAbortAction(true);
}