How to create "Copy incident number" like "Copy sys_id" (Context menus)?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-07-2016 07:06 AM
Hi Team,
We need one requirement like below:
As all knows, we can copy the sys_id/copy URL from top of each ticket. In the same way, how can we copy the Particular incident ticket number with URL? we need to implement same link like copy the sys_id/copy URLcontect menus (Copy Incident Number).
For example, If I right click on incident ticket it will give incident number with url :like this INC001234
Please help me to provide solution.
Thanks & Regards,
Prasanna Kumar

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-14-2016 06:09 AM
Hi Prasanna,
For what it's worth, the URL you gave is not a valid format. There's no such field as task_id in the dictionary (for an OOB instance.) Records are referred to by table and unique sys_id. Potentially a document ID, which still includes a table and sys_id. If you want the number, you would need to include it in a sysparm_query. Something like this.
Hopefully we have some flexibility in the requirements to make this work. Once we agree the line in bold above is acceptable, we can start looking at how to copy it to the clipboard.
This all comes from: Navigating by URL - ServiceNow Wiki
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-14-2016 10:18 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-15-2016 05:02 AM
Thanks. While I understand your requirement, I don't see an easy way to do it. There are a lot of undocumented features used in the existing Copy URL and Copy sys_id that I am unable to decipher without a few hours and several emails to developers.
My recommendation is to continue to use Copy URL as it provides the same functionality (a link to the record.) The only difference being is the actual URL being copied.
A simpler solution might be to go to System UI> UI Context Menus, and replicate/rename Copy URL to Copy Number.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-07-2016 07:20 AM
I would use one of the existing ones (Copy SysID or Copy URL) as an example. Go to System UI> Context Menus and make a copy.
Doesn't seem hard to modify.
Reference: Context Menus - ServiceNow Wiki
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-25-2016 06:21 AM
Hi Tomasi,
Please provide the script for the same. It would be very helpful to us.
Thanks & Regards,
Prasanna Kumar