Emergency change BR is not working
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
(function executeRule(current, previous /*null when async*/ ) {
var AGMember = false;
var currentUser = gs.getUser();
AGMember = currentUser.isMemberOf(current.assignment_group.getDisplayValue());
if (!(current.requested_by == gs.getUserID() || AGMember || current.opened_by == gs.getUserID()||gs.hasRole('change_manager'))) {
gs.addErrorMessage('should ');
current.setAbortAction(true);
} else {
current.work_notes = ' cancelled.';
}
})(current, previous);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
what's your business requirement?
is the BR itself not triggering?
what is that BR doing? I could see it's just setting the work notes.
Then why not set it via UI action itself?
-> Is this OOTB UI action?
-> If it's Custom then ensure you give unique action name for this UI action
->
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago - last edited 3 weeks ago
1.what's your business requirement?
Requirement is "opened_by" ,"requested_by", ",member of assignment group" and the user having "change_manager" role able to cancel the change.
2.is the BR itself not triggering?
BR is triggering ,but only for emergency change it is not working --stating error "action not authorized.
3. Is this OOTB UI action?
yes it is OOTB and i have added it in the OOTB those conditions.
It is working as fine for normal and standrad , but not for emergency . I have checked "transition condition"nothing has been added in emergency.
I have one display business Rule--that is used in "on change" client script -that is working as expected.
Pls help me in this !
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
the BR is only adding work notes.
Why not add that logic in UI action itself and BR is not required since you already updated the OOTB UI action?
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
UI action they don't want to change. I'm reverting back handling only via BR-
if (!(current.requested_by == gs.getUserID() || isAGMember || current.opened_by == gs.getUserID()||gs.hasRole('change_manager'))) {
gs.addErrorMessage('An change can only be cancelled by a member of the Assignment group,opened_by, requested_by. ');
current.setAborAction(true);
If they are not the "requested by user or openedby user or AG member and has role change manager. it will terminate the action or if they are part of any of this "work note" added...It is working as expected for normal and standard. but nor for emergency
Is emergency has any special condition or what should check?