how to add a prefix in incident number field accor... - ServiceNow Community

how to add a prefix in incident number field according to the domain

geetika20
Mega Contributor

Hi,

I want to add a prefix in incident number field according to the domains . For ex- if my domain is ABC then if I raise a incident the prefix should be like: ABC-INC-00000(number).

Can anyone suggest how to do this.

10 REPLIES 10

geetika20
Mega Contributor

pradeepksharma need your help


Munender Singh
Kilo Sage

Hi Geetika,



You can go to configuration panel and type 'number maintenance ' and then in table select 'Incident' and make the changes in the prefix as you desire.



Regards,


Munender



**Please mark helpful/correct if found useful


Hi Munender,



I cannot do that because it will fixed for every domain. I want on the basis of the logged in user domain, domain name should be added to prefix following the normal incident prefix.


I think, that's not good approach to update the number field on the fly, instead you can have custom field for number on incident form. Try with below After Insert Business Rule on incident table. I believe you need to create the BR at global domain.



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


var domainname = current.sys_domain.name;


current.u_number = domainname + '-' + current.number;


})(current, previous);