BR

Community Alums
Not applicable

Create a Business Rule on issues such that if priority is 1 it should not allow user to update the issues priority. (Abort operation). Need code for this

2 ACCEPTED SOLUTIONS

sorry I did a quick test, my condition is wrong, it should be something as below

SuyogAptikar_0-1698045047436.png

This will only trigger is priority is getting changed from critical to some other value

If my answer has helped with your question, please mark my answer as accepted solution and give a thumb up.



Best regards

Suyog

View solution in original post

Also due to want to restrict this only for user action i.e. when someone opens up form and try to do it or it should be restricted for request coming via 3rd party tool i.e. via integration?
if its only user then recommendation of @Vishal Birajdar is valid as it should be only restricted when user is trying to transact.
just for info from BR you can add message as well using gs.addInfoMessage().

If my answer has helped with your question, please mark my answer as accepted solution and give a thumb up.



Best regards

Suyog

View solution in original post

7 REPLIES 7

Harsh_Deep
Giga Sage
Giga Sage

Hello @Community Alums 

 

Create a before BR on Issue table with Update true, and condition Priority Changes From 1.

 

And use this code -

 

current.setAbortAction('true');

 

 

Mark Correct if this solves your issue and also mark 👍 Helpful if you find my response worthy based on the impact.

Vishal Birajdar
Giga Sage

Hi @Community Alums 

 

Technically, if you abort the action means not only priority but also others fields will not able to update.

Instead use client script to alert the user saying "You are changing the priority 1" something like this.

 

 

 

 

Vishal Birajdar
ServiceNow Developer

I know one thing, and that is that I know nothing.
- Socrates

MonteKunze
Mega Contributor

To create a Business Rule that prevents issue priority updates when it's set to 1, you can use JavaScript. The code snippet checks the priority and aborts the operation with a message if it's 1. Implement this code in your system while customizing it as needed.