Need solution for autonumbering in incident records

keerthika98
Tera Contributor

Each time when i open new incident form, a new incident number is generated.
If i don't submit and reopen it, another number will be generated.
If would like to prevent this behavior by implementing a custom business rule. Need sample code for this requirement.

5 REPLIES 5

Anirudh Pathak
Mega Sage

Hi @keerthika98 ,

Change the system property "glide.itil.assign.number.on.insert" to true.

 

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

Shivambitanwar1
Tera Contributor

Hi @keerthika98 ,

 

If you set glide.itil.assign.number.on.insert property to true , it will Assign a task number only upon insert (prevents unused numbers). You will not need a BR,

 

Warm Regards,

Shivambi

Harish Bainsla
Tera Sage
Tera Sage

Hi 

  1. Navigate to All > System Properties > System.
  2. Set the property Assign a task number only upon insert (prevents unused numbers), glide.itil.assign.number.on.insert

HarishBainsla_0-1708331924821.png

 

Priyanka_786
Tera Guru
Tera Guru

@keerthika98 :

 I believe your ask in only for incident table. If yes , please be thoughtful that if you use Property option as suggested by all other fellows as it will be applied on task level. (task table- which will apply to all inherited tables from task  not just incident).

So I would suggest go with Business Rule in this case. For logic, have a look into this thread-https://www.servicenow.com/community/developer-forum/auto-assign-incident-number-onsubmit-instead-of...

 Note:- In this thread Client script approach used ,but you can refer the same logic for Business Rule.

Hope it helps. Please mark helpful/accepted if it helps.

Regards,

Priyanka Salunke