Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Incident and change OOB servicenow allows for duplicate numbers. I need that stopped as it is impact

R1R3
Kilo Expert

Incident and change OOB servicenow allows for duplicate numbers. I need that stopped as it is impacting reporting. There are articles online how to fix/stop this from occurring

3 REPLIES 3

Dr Atul G- LNG
Tera Patron
Tera Patron

HI @R1R3 

 

 

Could you please tell us, where you finding these duplicates? In related list or form or where. A screesnshot will be helpful.

*************************************************************************************************************
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.

Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]

****************************************************************************************************************

swathisarang98
Giga Sage

Hi @R1R3 ,

 

You can refer below articles for getting duplicate value,

https://www.servicenow.com/community/developer-forum/seeing-duplicate-incidents-with-same-number/m-p... 

 

Also you can create a business rule as mentioned in the servicenow doc ,

https://docs.servicenow.com/bundle/washingtondc-platform-administration/page/administer/field-admini... 

 

Please mark this comment as Correct Answer/Helpful if it helped you.

Regards,

Swathi Sarang

Sumanth16
Kilo Patron

Hi @R1R3 ,

 

solution1 :

go to the dictionary of number field, you can set the default value of the number field as

 

Sumanth16_0-1709581150198.png

 

solution2 : 

go to the system properties list and search for "glide.itil.assign.number.on.insert", and set the value as 'true'.

 

Sumanth16_1-1709581150191.png

 

Solution 3:

 

create before business rule on table with below code:

(function executeRule(current, previous /*null when async*/) {




// Add your code here

 

var gr = new GlideRecord('incident');

 

gr.addQuery('number', current.number);

 

gr.query();

 

if(gr.next()) {

 

gs.addErrorMessage("An incident is already present with the same number " + current.number);

 

current.setAbortAction(true);

 

}




})(current, previous);

If I could help you with your Query then, please hit the Thumb Icon and mark it as Correct !!

 

Thanks & Regards,

Sumanth Meda