Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

how to embed hyperlink for SCTASK num and for worknotes

nameisnani
Mega Sage

Hi Team , 

only for particular catalog

We want make this SCTASK00001 ( as a url ) if user clicks on that means it has to redirect to that sctask .

 

nameisnani_0-1701065846581.png

 

 

 

In the same SCTASK we are populating this message in worknotes also . in worknotes also it has to be url 

 

nameisnani_1-1701065846580.png

 

 

 

can anyone please provide me step by step solution to achieve . 

Please provide screenshot for better understandig

 

thanks in advance 

1 ACCEPTED SOLUTION

Just put quotes around sc_task

var url = '[code]<a href="' + gs.getProperty('glide.servlet.uri') + '/'+'sc_task' + '.do?sys_id=' + gr.sys_id + '" target="_blank">' + workflow.scratchpad.task_number + '</a>[/code]';

 

Consider indicating the response as helpful and marking it as correct if it meets your needs.

View solution in original post

11 REPLIES 11

Sonam_Tiwari
Kilo Sage

@nameisnani , for having the url in worknotes, refer this thread: https://www.servicenow.com/community/developer-forum/how-do-i-display-a-clickable-url-in-my-work-not...

Consider indicating the response as helpful and marking it as correct if it meets your needs.

Aman Kumar S
Kilo Patron

Hi @nameisnani 

In order to embed URLs in the work notes, you need to enclose the URL between [code]YOUR URL[/code] tag.

 

Also ensure, glide.ui.journal.use_html system property is set to true, so HTML tags are allowed.

 

Best Regards
Aman Kumar

Hi @Sonam_Tiwari  @Aman Kumar S  

 

Is that possible embed the 1st - Sctask number (URL) on the 2nd sctask work notes via workflow please check my below code and correct . 

task.work_notes = "Please review the attachment on the " + workflow.scratchpad.task_number; // Retriving the Access Provision SCTASK num and updating the worknotes entry
task.description = "Please review the attachment on the " + workflow.scratchpad.task_number; // Retriving the Access Provision SCTASK num and updating the Description entry
task.work_notes = [code]< a title = 'workflow.scratchpad.task_number'href = 'sc_task.do?sys_id=-1'> < /a> [/code]

 

nameisnani_0-1701069248970.png

 

Hi @nameisnani 

Put everything within quotes " "

Best Regards
Aman Kumar