Automatically Generating Unique CI ID's

Not applicable

I'd like to have a mandatory unique ID for each CI, but Service-Now seems to allow duplicates of both the name and the asset tag. Additionally I'd like for that Unique ID to be automatically entered by Service-Now when a CI is created. The name should be meaningful and so derived from the CI Class and what is entered into some of the CI attributes.

For example say it was the 100th Linux Server we'd entered and when we created it we filled in a field to say it was only used by the Finance department. An ID would be created for that CI called LNX-FIN-100. The next Linux Server for the Finance department would be called LNX-FIN-101. I haven't yet thought through the exact naming convention, so I may also want to include other things e.g. the domain which entered it, though obviously they need to be things that won't change during the life of the CI.

Is this type of thing doable? And if so how would I go about it. Any suggestiong will be gratefully received.

Kind Regards
Helen

9 REPLIES 9

Not applicable

You could also use the same approach as we do for tasks. In the number maintenance table you specify a table, the prefix and start number. So if you want a unique prefix for each CI class you need one number per table. Then on your dictionary entry for the field you enter javascript:getNextObjNumber(); as the default value. This is how incident, problem,change etc work.
Dave


Not applicable

Also if you want leading zeros on the numeric suffix you can use getNextObjectNUmbrPadded. The nmber maintenance entry allows you to specify length of padding.


Not applicable

Thank you. I'll let you know how we get on.


Not applicable

Thanks for the advice. We decided to use number maintenance so our unique ID's are the CI Class followed by an incremental number.


likoko
Tera Contributor

Interesting approach. We basically used the same for our finance department.