Add a prefix to Request Item and Catalog Task according to the application the ticket is submitted
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-13-2023 04:23 AM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-13-2023 04:28 AM
Is Service Desk some custom app in your instance?
how are you differentiating if RITM is for Service Desk?
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-13-2023 05:23 AM
@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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-27-2023 01:57 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-13-2023 05:36 AM
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.