- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-25-2016 12:08 PM
I am trying to implement a clickable link to the RITM# in a catalog task. What is the general syntax around this? I've read up on the wiki.
function onDisplay(current, g_scratchpad) {
//This function will be automatically called when this rule is processed.
var ritmAttachments = new GlideRecord('sc_req_item');
ritmAttachments.addQuery('sys_id', current.request_item.sys_id);
ritmAttachments.query();
while (ritmAttachments.next()){
if(ritmAttachments.hasAttachments()){
gs.addInfoMessage('Please see ' + current.request_item.getDisplayValue() + ' for attachments related to this task.'); //Wanting to make THIS clickable
gs.addInfoMessage('You can track status from the <a href="home.do" class="breadcrumb" >Home Page</a>'); //What goes here to put the URL for the parent record????
}
}
}
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-25-2016 01:37 PM
Hi William,
Try using something like this:
var url = 'sc_req_item.do?sys_id=' + current.request_item.sys_id;
var msg = 'Please see ' + current.request_item.getDisplayValue() + ' for attachments related to this task.'
gs.addInfoMessage("<a href='" + url + "'>" + msg + "</a>");
Thanks,
-Brian

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-25-2016 01:37 PM
Hi William,
Try using something like this:
var url = 'sc_req_item.do?sys_id=' + current.request_item.sys_id;
var msg = 'Please see ' + current.request_item.getDisplayValue() + ' for attachments related to this task.'
gs.addInfoMessage("<a href='" + url + "'>" + msg + "</a>");
Thanks,
-Brian
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-26-2016 08:50 AM
That is very helpful, thank you Brian!
I adopted your code a bit and used the following, as I think it looks a bit cleaner with only the RITM# highlighted. Thanks for the quick response.
function onDisplay(current, g_scratchpad) {
//This function will be automatically called when this rule is processed.
var ritmAttachments = new GlideRecord('sc_req_item');
ritmAttachments.addQuery('sys_id', current.request_item.sys_id);
ritmAttachments.query();
while (ritmAttachments.next()){
if(ritmAttachments.hasAttachments()){
var url = 'sc_req_item.do?sys_id=' + current.request_item.sys_id;
var ritmNum = current.request_item.getDisplayValue();
//var msg = 'Please see ' + ritmNum + ' for attachments related to this task.';
//gs.addInfoMessage("<a href='" + url + "'>" + msg + "</a>");
gs.addInfoMessage('Please see '+"<a href='" + url + "'>" + ritmNum + "</a>" + ' for attachments related to this task.');
//gs.addInfoMessage('You can track status from the <a href="home.do" class="breadcrumb" >Home Page</a>');
}
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-26-2016 09:07 AM
Hi William,
Here How I achieved a similar query to yours, Every time I send an email to our users, they've got the incident/request/req_item/task number into the email which is clickable and redirect them to the appropriate form,
Here is an example of incident, you can customize it as your requirement :
Under you email notification :
insert this following row : Call : (${URI_REF}/${nameOfYourField})
Kind regards,
ZA
Do not feel shy to mark correct or helpful answer if it helps or is correct

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-26-2016 11:32 AM
Sure, no problem. Please mark as correct if it was a solution.
Thanks,
-Brian
Edit: *Thanks*