- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-16-2023 11:46 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-16-2023 11:49 PM
Hi @Community Alums , you can use before Business Rule with insert and update checked where condition will be 'short description changes'
Here is the script :
(function executeRule(current, previous /*null when async*/ ) {
// Add your code here
var shortDescription = current.short_description;
var gr = new GlideRecord('incident');
gr.addQuery('short_description', shortDescription);
gr.query();
if (gr.hasNext()) {
gs.addErrorMessage('Short Description already exists');
current.setAbortAction(true);
}
})(current, previous);
Note : you can replace hasNext() with next() if you want to show the Incident Number on the error message.
Mark this as solution if it's working 🙂
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-16-2023 11:49 PM
Hi @Community Alums , you can use before Business Rule with insert and update checked where condition will be 'short description changes'
Here is the script :
(function executeRule(current, previous /*null when async*/ ) {
// Add your code here
var shortDescription = current.short_description;
var gr = new GlideRecord('incident');
gr.addQuery('short_description', shortDescription);
gr.query();
if (gr.hasNext()) {
gs.addErrorMessage('Short Description already exists');
current.setAbortAction(true);
}
})(current, previous);
Note : you can replace hasNext() with next() if you want to show the Incident Number on the error message.
Mark this as solution if it's working 🙂
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-16-2023 11:50 PM
Hi @sreeshsurendran - thanks it's working as expected

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-16-2023 11:54 PM
Hi,
Create before business rule with condition
Use a condition like current.short_description.changes() && current.short_description.getJournalEntry(1).newValue === current.short_description.getJournalEntry(2).newValue.
also write script
current.setAbortAction(true);
gs.addErrorMessage("Another incident with the same short description already exists.");
Thanks,
Rahul Kumar
Thanks,
Rahul Kumar

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-17-2023 12:00 AM
To be sure:
is this a real requirement?