Incident Short Description or Description as a link?

Jason Stephens
Kilo Guru

We have some auto-opened incidents that get created from SolarWinds. The short description and description populates with a string like "URL: http://SW45ORION:80/Orion/View.aspx?NetObject=N:2606 at 10/28/2011 8:15:51 ". Is there a way to make this a clickable link? As of right now,our techs have to copy and paste this line into a browser. If possible, I would like to make this an actual link and cut out the copy and paste step.

16 REPLIES 16

Brad Tilton
ServiceNow Employee
ServiceNow Employee

I think since those are string type fields they'll only do plain text. I don't know if this is possible in your case, but I've included links in tickets by using journal fields, since they allow html.

http://wiki.service-now.com/index.php?title=Using_Journal_Fields#Using_CODE_Tags_to_Render_HTML_in_a_Journal_Field


This might work for you. Check out this incident record in the Demo09 instance:
https://demo09.service-now.com/nav_to.do?uri=incident.do?sys_id=a07f5030f14210007a18e0f8bdde3990.

I created a read-only, calculated URL field on the Incident form that grabs the URL out of the Short description field and will only appear if populated:
https://demo09.service-now.com/nav_to.do?uri=sys_dictionary.do?sys_id=9c7f5030f14210007a18e0f8bdde394f

Open URL

Here is the calculation in the Dictionary record for the field:


answer='';
var linkAt = current.short_description.toLowerCase().indexOf('url: /http://')
if (linkAt >= 0) {
var linkTo = current.short_description.indexOf(' at ');
answer = current.short_description.substring(linkAt+5, linkTo);
}


You'll want to remove the leading "/" in "/http:" as without out, the post is all messed up.

There is also a UI Policy to display the field only if it is populated with something:
https://demo09.service-now.com/nav_to.do?uri=sys_ui_policy.do?sys_id=97806070f14210007a18e0f8bdde39f7

An alternative would be to create a UI Action that would parse the Short description field and open a new window/tab with the URL. Only display it based on the contents of the Short description field.


I apologize, but do you care to show me the UI Policy? Our Solarwinds admin team had other issues to work out, and we are just now getting back to this. I got it to populate correctly, but for some reason it stays 'read-only' and is not 'clickable' as a link....

Not sure what I'm doing wrong.

Thanks,
Jason


OK, I recreated it in demo09 again. Make sure it is a field of type "URL". Take a look at it as soon as possible 🙂

Incident record - https://demo09.service-now.com/nav_to.do?uri=incident.do?sys_id=42bee2237bf310007a1814aa3f4d4df9

Dictionary record - https://demo09.service-now.com/nav_to.do?uri=sys_dictionary.do?sys_id=a5be22237bf310007a1814aa3f4d4d1b

UI Policy - https://demo09.service-now.com/nav_to.do?uri=sys_ui_policy.do?sys_id=60bfa6237bf310007a1814aa3f4d4df1