Integration creating duplicate record
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-31-2023 11:07 AM
Hi Experts,
I have created a business rule to abort duplicate incident/vendor case ID creation in abc domain.
that is not allowing me to create duplicate incident with same vendor case id in my instance.
but whenever third party is creating a ticket then its allowing to create duplicate incident vendor case id ticket.
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
business rule i have written--
before/ insert
vendor case ID ---- is not empty
script:
var gr= new GlideRecord('incident');
gr.addQuery('u_vendor_case_id', current.u_vendor_case_id);
gr.query();
if(gr.next()){
current .setAbortAction(true);
}else{
// allow to create ticket
}
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
please provide your answer , how to restrict or avoid duplicate vendor case id ticket .
thanks in advanced.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-31-2023 10:30 PM
Hi,
Try to make dictionary record for that field as Unique, you can personalize the form and add the "unique" field.
you can take a help from here also:

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-31-2023 11:14 PM
Hi @Nawal Kishor Si ,
Try as below
var gr= new GlideRecord('incident');
gr.addQuery('u_vendor_case_id', current.u_vendor_case_id);
gr.query();
if(gr.next()){
current .setAbortAction(true);
}
else{
if(){//state your condition here
current.setAbortAction(true);
}
else{
// allow to create ticket
}
Along with this as @Ankita19 suggested make it unique if you wish.
Please mark correct if my response has solved your query.
Cheers,
Mohammed Basheer Ahmed.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-31-2023 11:27 PM
Hello,
Can you tell us How the third party is creating the incident. Is it via some REST API or Data load Transform map?
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-01-2023 04:05 AM
Open your business rule in list view, there is a Web service flag there. Try to set it to true if that works.