- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-10-2025 01:28 AM
Hi
I have created some incident reports which are scheduled to export. Once the data is exported in to CSV or Excel it loses any HTML hyperlinks. I would like to have a field for each incident that retains an HTML link to the ticket as it appears in ServiceNow.
Here the link is clickable and takes me to the incident. How can I retain this link at export or create a field that has a link.
I have seen that I can add additional fields with URL or Hyperlink functionality, but I am unsure what information to add to have that field contain the relevant incident ID of the ticket.
If you can help that would be appreciated.
Thanks
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-25-2025 01:53 AM
Unfortunately I have been unable to get this working correctly, I have tried following the steps above but am unable to get the URL field to display the correct information. I am closing the case for now, as I am changing the way we create reports.
Thanks for your help
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-14-2025 06:39 AM
Hello @StevenITSM ,
Unfortunately it will loose the HTML Content when you'll export in the excel. But you can create say URL or may be string field(make sure to make it read only so that it is not editable from the SN front end).
You will have to write may be one time fix script or some BR's some sort of point of trigger if you are looking at it from the perspective of dynamic url creation(but I think that's insignificant). Please see the code below how to achieve the url:
var incGr = new GlideRecord('incident');
incGr.addQuery('sys_id','e0af09d9831312107412f4b6feaad303');
incGr.query();
if(incGr.next()){
incGr.short_description = gs.getProperty("glide.servlet.uri") + incGr.getLink();
incGr.update();
}
You can run it from background script and see the field say short description getting populated. You can choose any field of type string and then update it with this link or you can have url type filed all together and update it the same way. If you wanna perform one time activity i.e. once you add the field to hold the url you can run the script once again
var incGr = new GlideRecord('incident');
//incGr.addQuery('sys_id','e0af09d9831312107412f4b6feaad303');
incGr.addEncodedQuery('your matching criterion where incident is created on or xyz fileter criteria');
incGr.query();
while(incGr.next()){ //iterate withi while
incGr.short_description = gs.getProperty("glide.servlet.uri") + incGr.getLink();
incGr.update();
}
Please mark this response as helpful as it will motivate me to help others as well.
Thank you,
Mahesh.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-14-2025 06:43 AM
the only way is to use a custom URL field.
OR
Another way is to include link for report in scheduled report email
<p> </p>
<p>Hi Team,</p>
<p><a href="nav_to.do?uri=sys_report_template.do?jvar_report_id=03ec52ca532130104c90ddeeff7b12e3"> Click to view the Report</a></p>
Then when they visit, they can open the incident records
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-15-2025 06:47 AM
Hope you are doing good.
Did my reply answer your question?
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-18-2025 01:37 AM
Thanks for the feedback, I am working through testing this solution an will let you know if successful.