Incident Short Description or Description as a link?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-28-2011 06:15 AM
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.
- Labels:
-
Incident Management

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-16-2012 09:39 AM
You got me. I have the exact same thing you do. It happens once I make the Dictionary entry "calculated". Once it is set to calculated, the current attachments (if any) do not show, and it will act like you can't add another. If I go look at the record as an admin, I see the attachment, and I will see the new one that I added. As ITIL, you don't see anything. As long as the field is not set to "calculated", then the attachment function works just fine.
Jason.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-16-2012 11:28 AM
I see it happening in demo20 now - that is definitely weird. Well, there is always a way - check out the following Business Rule (Before Insert and Update):
https://demo20.service-now.com/nav_to.do?uri=sys_script.do?sys_id=1cbce8e07b90200050e914aa3f4d4d2a
I unchecked Calculated on the Open URL field and the Business Rule will now populate it.
setOpenURL();
function setOpenURL() {
localAnswer='';
var linkAt = current.short_description.toLowerCase().indexOf('url: http://')
if (linkAt >= 0) {
var linkTo = current.short_description.indexOf(' at ');
localAnswer = current.short_description.substring(linkAt+5, linkTo);
}
current.u_open_url = localAnswer;
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-16-2012 11:48 AM
Awesome - that got it. I have no idea what the issue is wit calculated, but I'm glad we got around it. I really appreciate the help on this one.
Jason
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-03-2012 01:36 PM
I was thinking about this one and came up with a purely client script solution which does not need an additional field on the table.
You can do it with 2 client scripts - one adds an img object to the Short description label and the other hides/displays it based on the contents of the field.
Here's the onLoad script to create the image object:
function onLoad() {
//add a UI Macro to a non-reference field
var field = document.getElementById('label.incident.short_description');
try {
//Create the image element and add to the DOM
var img=document.createElement('img');
img.id='openSolarWinds';
img.src='solarwinds.gifx';
img.alt='Open SolarWinds Link';
img.title='Open SolarWinds Link';
var link=document.createElement('a');
if (navigator.appName == 'Microsoft Internet Explorer'){
link.setAttribute('onclick', Function('openSolarWindsLink()'));
} else {
link.setAttribute('onclick', 'openSolarWindsLink()');
}
link.name='openSolarWindsLink';
link.id='openSolarWindsLink';
link.appendChild(img);
field.appendChild(link);
}
catch(e) {}
}
//onclick event to fire when the image is clicked
function openSolarWindsLink() {
var linkAt = g_form.getValue('short_description').toLowerCase().indexOf('url: /http://')
if (linkAt >= 0) {
var linkTo = g_form.getValue('short_description').indexOf(' at ');
var urlLink = g_form.getValue('short_description').substring(linkAt+5, linkTo);
window.open (urlLink);
}
}
And the onChange script (on the Short description field) to display/hide the image:
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (newValue.toLowerCase().indexOf('url: /http://') >= 0) {
$('openSolarWindsLink').show();
} else {
$('openSolarWindsLink').hide();
}
}
The idea is based on an older SNCguru article that I've used in a couple scenarios (http://www.servicenowguru.com/system-ui/ui-macros/add-macro-non-reference-field/)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-26-2015 08:23 AM
Hello Jim - I know this is older...but I'm trying to do something similar and can't get it to work.
Currently Nimsoft is creating alerts (customer table) and is passing string to the Description field.
I want to parse out an https:// link and make it clickable either in the Description field or pull it to the URL link.
I can't get what you have written here, to work. Any suggestions?
Thanks in advance.