
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-22-2023 11:47 PM
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
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-23-2023 12:11 AM
sorry I did a quick test, my condition is wrong, it should be something as below
This will only trigger is priority is getting changed from critical to some other value
Best regards
Suyog
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-23-2023 12:22 AM
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().
Best regards
Suyog
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-23-2023 12:03 AM - edited 10-23-2023 12:18 AM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-23-2023 12:04 AM
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.
ServiceNow Developer
I know one thing, and that is that I know nothing.
- Socrates
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-07-2023 04:46 AM
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.