- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-04-2023 02:45 AM
I am trying to create a tiny URL dynamically via a script and need to know how to get it working.
For reference, I tried to follow advice from https://www.servicenow.com/community/developer-forum/how-to-convert-long-url-to-tiny-url-without-pro... but the question remains unsolved.
Any help appreciated!!
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-04-2023 10:58 AM
Hi there,
Can you share what you tried exactly?
When I add manually a new sys_tiny_url record, and open it, it works fine.
Tiny URL record created:
Tiny URL [tiny_url]: community_test
Data [data]: =active%3Dtrue%5EnumberININC0010048%2CINC0010047%2CINC0010046%2CINC0010045%2CINC0010044%2CINC0010043%2CINC0010042%2CINC0010041%2CINC0010040%2CINC0010039%2CINC0010038%2CINC0010037%2CINC0010036%2CINC0010035%2CINC0010034%2CINC0010033%2CINC0010032%2CINC0010031%2CINC0010030%2CINC0010029&sysparm_view=
URL to open:
This basically opens a list of incidents, with as query a bunch of incident numbers.
Kind regards,
Mark Roethof
Independent ServiceNow Consultant
10x ServiceNow MVP
---
~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-31-2024 12:29 PM
Check out the GlideTinyUrl class. Do a code search in your instance and you can find some examples.
For example:
new GlideTinyURL().createTinyURL(url);
or if you always want it to be a tiny url
new GlideTinyURL().createTinyURLWithCustomLength(url, 10);
Pretty sure it is a global only API so you might need to wrap it in a global script include, but thats alot better than making ajax request from the server to the server haha. The default one will use the system property
glide.tiny_url_min_length
to determine when to generate a TinyURL and when to just passthrough the URL.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-04-2023 09:44 AM
Hi, what is your use case, why tiny URLs are required? Please elaborate

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-04-2023 10:58 AM
Hi there,
Can you share what you tried exactly?
When I add manually a new sys_tiny_url record, and open it, it works fine.
Tiny URL record created:
Tiny URL [tiny_url]: community_test
Data [data]: =active%3Dtrue%5EnumberININC0010048%2CINC0010047%2CINC0010046%2CINC0010045%2CINC0010044%2CINC0010043%2CINC0010042%2CINC0010041%2CINC0010040%2CINC0010039%2CINC0010038%2CINC0010037%2CINC0010036%2CINC0010035%2CINC0010034%2CINC0010033%2CINC0010032%2CINC0010031%2CINC0010030%2CINC0010029&sysparm_view=
URL to open:
This basically opens a list of incidents, with as query a bunch of incident numbers.
Kind regards,
Mark Roethof
Independent ServiceNow Consultant
10x ServiceNow MVP
---
~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-31-2024 12:29 PM
Check out the GlideTinyUrl class. Do a code search in your instance and you can find some examples.
For example:
new GlideTinyURL().createTinyURL(url);
or if you always want it to be a tiny url
new GlideTinyURL().createTinyURLWithCustomLength(url, 10);
Pretty sure it is a global only API so you might need to wrap it in a global script include, but thats alot better than making ajax request from the server to the server haha. The default one will use the system property
glide.tiny_url_min_length
to determine when to generate a TinyURL and when to just passthrough the URL.