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.

How to dynamically change the prefix of incident according priority.

Vinayak Patil
Tera Contributor

How to dynamically change the prefix of incident, according priority.

When priority is 1 then Incident number will be INC123.

When priority is 2 then incident number will be ABC123.

 

1 REPLY 1

nityabans27
Kilo Patron

Hi @Vinayak Patil,

Dynamically change Incident number prefix based on priority

  • Priority 1 → INC123

  • Priority 2 → ABC123


⚙️ Option 1 – After Insert BR (simple & quick)

  • Create After Insert Business Rule on incident.

  • Script updates the prefix after record creation:

     
    var prefix = current.priority == 1 ? 'INC' : 'ABC'; var numPart = current.number.replace(/\D/g, ''); current.number = prefix + numPart; current.update();

Easy to implement
⚠️ Causes a second update after insert