Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Warning message associated with groups

Polyanna Silva
Tera Contributor

I need to insert a warning and blocking message associated with specific groups. How can I do this?
Currently I'm using Business Rules, but I haven't implemented them correctly.

2 REPLIES 2

SanjivMeher
Mega Patron
Mega Patron

When do you want to show the warning or block message?

It depends on your use case. You can use Business Rule or Client Script to show the message.

Also if you can post the current BR script you have?


Please mark this response as correct or helpful if it assisted you with your question.

The message needs to be displayed when a specific group is selected; the script I created is associated with both input and output groups.
I'll send the standard script:
(function executeRule(current, previous /*null when async*/) { var allowedGroups = ['Group A', 'Group B', 'Group C']; var destinationGroups = ['Group D', 'Group E', 'Group F']; if (destinationGroups.indexOf(current.assignment_group.name) > -1 && allowedGroups.indexOf(previous.assignment_group.name) === -1) { gs.addErrorMessage('You do not have permission to assign to this group.'); current.assignment_group = previous.assignment_group; // Reverts the change } })(current, previous);


I didn't do it through the Client Script because it's associated with a catalog item, and I need it to be associated with a group.