The Zurich release has arrived! Interested in new features and functionalities? Click here for more

Asset tag generator

dvelloriy
Kilo Sage

Hi Team,

we have a requirement to create a utility to generate asset tags. So the requester can select how many asset tags need to be generated and then click submit. Upon submission, the utility should check existing asset tags and generate unique ones. I am planning to create a catalog item for this.

customer is doing this activity manually currently before asset receiving process. This automation would save some time and effort.

Any advice here would be appreciated.

2 REPLIES 2

XiaoC
Giga Contributor

Hi, did you ever figure out a solution for this? we are in the process of something similar but was having challenge keeping track of the last tag printed.

Benjamin A
Mega Sage

Hi @dvelloriy & @XiaoC ,

 

It would depend on your organization and how you already handle asset tags. Do you have all of your in-use or previously used asset tags populated on either cmdb_ci or alm_asset? Have you previously followed any sequential formatting or do you randomly generate asset tags?

 

If you have followed sequential formatting I'd create a system property that stores the "highest" asset tag and use a script to calculate the next X number of asset tags based on that property and store the new value in the properties to essentially "reserve" the generated values. You could run a query to check the availability of these tags such as 

 

 

var gr = new GlideRecord('alm_asset')
gr.addEncodedQuery('asset_tagIN{comma seperated values}');
gr.query();
if(gr.getRowCount() > 0){
//handle error
}

 

 

Does this help?

 

Thanks,

Ben