Duplicate incident creation restriction in servicenow

nitin51
Tera Contributor

Hi team, how to stop duplicate incident creation using fields. if suppose, created by, opened by, few words in short description and description matches. we need to restrict the duplicate incident creation. please help me on this.

11 REPLIES 11

OlaN
Giga Sage
Giga Sage

Hi,

Please avoid creating duplicate questions in the community.

Close this thread, and keep the discussion going in the first question you made.

https://community.servicenow.com/community?id=community_question&sys_id=a2f0b56cdb89c510a5388263059619e9

Thameem Ansari
Giga Guru
Giga Guru

Hi Nitin,

 

Create a before Business Rule in the incident table. and make it run only on insert.

 

then in advance tab write the below code

 

 

var incGr=new GlideRecord('incident');

incGr.addActiveQuery();

incGr.addQuery('sys_created_by',current.sys_created_by);

incGr.addQuery('opened_by',current.opened_by);

incGr.addQuery(' description', 'LIKE',current.description);

incGr.addQuery('short_description','LIKE',current.short_description);

incGr.query();

if(incGr.next()){
gs.addErrorMessage('Possible duplicate incident detected : ' +incGr.number);

current.setAbortAction(true);
}


Please mark it as helpful/correct If my answer is helpful in any way,

Best regards,

Thameem

incGr.addQuery(' description', 'LIKE',current.description);

 

So, under "LIKE" keyword, I need to add sentence right?

 

which duplicate incident also have same sentence while creation?

yes. LIKE is an operator which will check if the field contains any value the same as the one we are giving.