The CreatorCon Call for Content is officially open! Get started here.

Integration creating duplicate record

Nawal Kishor Si
Tera Contributor

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.

4 REPLIES 4

Ankita19
Tera Guru

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:

https://docs.servicenow.com/en-US/bundle/tokyo-platform-administration/page/administer/field-adminis...

Basheer
Mega Sage

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 hit like button if my suggestion has helped you in any way.
Please mark correct if my response has solved your query.

Cheers,
Mohammed Basheer Ahmed.

Ajay30
Mega Guru

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

Kirby R
Kilo Sage

Open your business rule in list view, there is a Web service flag there. Try to set it to true if that works.