Add a prefix to Request Item and Catalog Task according to the application the ticket is submitted

Nagashree5
Tera Contributor

Hi All,

 

I want to add a prefix in RITM and Catalog Task number field according to the application the RITM's have been created. Basically, here it is only Service Desk application. For ex- if my application is Service Desk then if I raise a RITM or Catalog Task the prefix should be like: SD-RITM-00000(number).

Can anyone suggest how to do this.

 

Thank you in Advance.

5 REPLIES 5

Ankur Bawiskar
Tera Patron
Tera Patron

@Nagashree5 

Is Service Desk some custom app in your instance?

how are you differentiating if RITM is for Service Desk?

 

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

@Ankur Bawiskar , yes it a scoped application. Planning to build the catalog items in the application but it should have a prefix of SD before the RITM number.

Hi @Ankur Bawiskar ,

 

Can you please share your thoughts on this.

 

Thank you in Advance.

Community Alums
Not applicable

Well...I don't believe it's a good practice to do that in the number field. This is handle by the platform in the table definition, middle tab, auto number + prefix + number (if I recall it correctly as of namings). So it would be better to create new field (lets say Distinct Number) and do that there, by appending the SD/HR/CM/etc to the RITMXXXXXXX.

Then you could use (where you start creating the RITMs from your REQ for ex.) gs.getCurrentScopeName() or gs.getCurrentApplicationId() to get the current app and pass the needed prefix to the new custom field.

If there is other way, I would like to know about it for sure.