Welcome to Community Week 2025! Join us to learn, connect, and be recognized as we celebrate the spirit of Community and the power of AI. Get the details  

Using hyperlink in work notes

CJPeterson
Tera Expert

Hi All, 

I am having some trouble with my script. I am creating a incident from a ticket but I need to update a work note to the ticket with details of the created incident (something like Incident  # has been created)

I am using "Incident [code]<a href="incident_url" target="_blank">INC_number</a>[/code] has been created. But that does not seem to be working and not redirecting to incident. 

Could someone please advise on what I may be missing? 

CJPeterson_0-1709233466137.png

CJPeterson_1-1709233500135.png

 

1 ACCEPTED SOLUTION

Sandeep Rajput
Tera Patron
Tera Patron

@CJPeterson Update your worknote as follows.

 

current.work_notes = 'Incident [code]<a href="'+gs.getProperty('glide.servlet.uri')+'nav_to.do?uri=incident.do?sys_id='+sysID+'" target="_blank">INC_number</a>[/code] has been created.';

 

Hope this helps.

View solution in original post

6 REPLIES 6

Mark Roethof
Tera Patron
Tera Patron

Hi there,

 

So what is "incident_url", I don't see that defined in your code.

 

Kind regards,

 

Mark Roethof

Independent ServiceNow Consultant

10x ServiceNow MVP

---

 

~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field

LinkedIn

Ivan Betev
Mega Sage
Mega Sage

Hi @CJPeterson ,

 

Shouldn't you be using URI / URI_REF here to get a link?


Something to read: Links to records in email notifications

 

Regards, Ivan

James Chun
Kilo Patron

Hey @CJPeterson,

 

Am I missing something or are you not using the actual URL to the incident in the href attribute? 

If so, try setting 

..... href = "<your instance>/incident.do?sys_id=' + sysID + '" ....

 

Hope it helps, cheers

Sandeep Rajput
Tera Patron
Tera Patron

@CJPeterson Update your worknote as follows.

 

current.work_notes = 'Incident [code]<a href="'+gs.getProperty('glide.servlet.uri')+'nav_to.do?uri=incident.do?sys_id='+sysID+'" target="_blank">INC_number</a>[/code] has been created.';

 

Hope this helps.