Issue while inserting hyper link in worknotes
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
When task is created we are trying to update worknotes on case with task hyperlink by using this script
var task = "[code]<a href='/"+current.sys_class_name+".do?sys_id="+current.sys_id+"'>"+current.number+"</a>[/code]";
parentcase.work_notes = gs.getMessage("Case Task (0) has been created", task);
But we are getting output as
Case Task <a href='*******'>PROT0001261</a> has been created
Instead of hyperlink to the number we are getting like above. Please provide steps to fix it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago - last edited 3 weeks ago
Your servicenow domain name was missing in URL.
Try with this :
parentcase.work_notes = 'Case Task [code]<a href="'+gs.getProperty('glide.servlet.uri')+'nav_to.do?uri='+current.sys_class_name+'.do?sys_id='+current.sys_id+'" target="_blank">'+current.number+'</a>[/code] has been created.';
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi @Tanushree Maiti, thanks for your response.
I used the script given but this is the output I'm getting
Case Task <a href="******" target="blank">PROT0001269</a> has been created.
Can you suggest any other option to fix it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Check Parentcase work notes field is Journal field or not. Code tag works on Journal field .
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hello @charanpatnala, Try this below code...
var task = '[code]<a href="' + gs.getProperty('glide.servlet.uri') + '/'+ current.sys_class_name + '.do?sys_id=' + current.getUniqueValue() + '" target="_blank">' + 'Case Task '+current.number+' has been created.' + '</a>[/code]';
Parentcase.work_notes = task;
parentcase.update();
Please mark the answer helpful if the above code helps you!
