- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-29-2015 07:06 AM
If a ticket exists with the same short description that you have written in a new ticket, an alert message should come that this incident already exists and ticket should not get submitted. How can we do this
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-29-2015 07:22 AM
Hi Sachin,
Please refer the below script. You can write a business rule with the below script.
function onBefore(current, previous) {
var gr = new GlideRecord('incident');
gr.addQuery('short_description', current.short_description);
gr.query();
while(gr.next())
{
gs.addInfoMessage('Ticket already exists'); //Change the message as per your req.
current.setAbortAction(true); //aborts the record
}
}
I hope this helps

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-29-2015 07:12 AM
Hi Sachin,
You can write a client script+ GlideAjax or the business rule which will abort the record submission.
Please let me know if you have any questions.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-29-2015 07:22 AM
Hi Sachin,
Please refer the below script. You can write a business rule with the below script.
function onBefore(current, previous) {
var gr = new GlideRecord('incident');
gr.addQuery('short_description', current.short_description);
gr.query();
while(gr.next())
{
gs.addInfoMessage('Ticket already exists'); //Change the message as per your req.
current.setAbortAction(true); //aborts the record
}
}
I hope this helps