How to add clickable link from Flow Designer to Task associated to incident

melsarrazin
Tera Contributor

When a task is closed, a note with some details will be added to the parent incident. I am trying to add a link to the parent incident work notes that when clicked, will take the user directly to the task. 

I have searched through Community and have found a few ideas but nothing has worked. 

 

Any additional ideas are greatly appreciated.

 

melsarrazin_1-1748374529843.png

melsarrazin_2-1748374593507.png

melsarrazin_3-1748374619615.png

 

melsarrazin_0-1748374487557.png

 

9 REPLIES 9

@melsarrazin 

looks like code tags may not function as expected in scoped applications. They work fine in global scope.

Ankur Bawiskar
Tera Patron
Tera Patron

@melsarrazin 

check my blog and you can enhance it for work notes

ServiceNow Flow Designer: Adding Record Link in "Send Email" flow action

it worked fine for me, see below and it added link in work notes.

I am in global scope, that should not be an issue

AnkurBawiskar_0-1748408069081.png

AnkurBawiskar_1-1748408083764.png

 

AnkurBawiskar_2-1748408113523.png

 

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

SuyashJ41731830
Tera Contributor

Hi
@melsarrazin 
Business Rule

(function executeRule(current, previous /*null when async*/) {

// Check if there is a parent record (assumes field is named 'parent')
if (!current.parent) {
return;
}

var parent = new GlideRecord('incident');
if (parent.get(current.parent)) {
// Create a link to the current task
var taskLink = gs.getProperty('glide.servlet.uri') + current.getLink(true);

var message = 'Child Task "' + current.number + '" has been closed. View it here: ' + taskLink;

parent.work_notes = message;
parent.update(); // This adds to the work notes
}

})(current, previous);
Regards,
Suyash

Ankur Bawiskar
Tera Patron
Tera Patron

@melsarrazin 

the reason it's coming as text and not link is that you are placing the flow variable in work notes

although link is there in that flow variable it's considering it as text

what you can do is -> use inline f(x) script here and form the link there itself rather than using flow variable

AnkurBawiskar_3-1748409474572.png

 

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

@melsarrazin 

Hope you are doing good.

Did my reply answer your question?

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader