How to insert a link in Notification and it will redirect to Agile board of Project?

Ramu6
Tera Contributor

Hi All,

Actually we have a requirement we have notification on Project table, in that body we have to insert a link that will redirect to Agile board of Project plannings?

Please help me to complete this

 

Thanks

Ramu

1 ACCEPTED SOLUTION

 

Try this:

 

var baseLink = gs.getProperty('glide.servlet.uri')

 template.print("<a href=" + baseLink + "$agile_board.do#/sprint_tracking> Agileboard</a>")

View solution in original post

6 REPLIES 6

Siddhesh Gawade
Mega Sage
Mega Sage

Hello @Ramu6 ,

 

 

If you have a static url, you can just simply use, html editor option from screenshot:

SiddheshGawade_0-1704384808720.png

 

 

If you wanted to make it dynamic, See the below notifcation email script for example, by using this I can surely say you can create lot more complex link for you email notification. 

(function runMailScript(current, template, email, email_action, event) {

    var mark = email.watermark;
    var baseLink = gs.getProperty('glide.servlet.uri')
    var instance = gs.getProperty("instance_name");
    var link = "https://" + instance + ".service-now.com";
    var emailAddress = instance + "@service-now.com";

    var googleLink = 'https://www.facebook.com';


    template.print('<a href="https://www.facebook.com"> Google</a>');

    template.print("<a href=" + baseLink + "incident_list.do?sysparm_clear_stack=true> Approve</a>");




    template.print('<span style="color: #ffffff;"><span id="requestapprove" class="btn" style="margin-left: 16px; border-radius: 4px; border: 1px solid #ffffff; padding: 6px 16px; background-color: #4f52bd;">');
    template.print('<a href="mailto:' + emailAddress + '?subject=Re:' + current.sysapproval.number + ' ' + ' - approve&body=%0A%0A' + mark + '"style="color:white;font-size:16px;font-weight:bold;"' + link + '"> Approve</a></span>');


    template.print('<span style="color: #ffffff;"><span id="requestreject" class="btn" style="margin-left: 25px; border-radius: 4px; border: 1px solid #ffffff; padding: 6px 16px; background-color: #4f52bd;">');
    template.print('<a href="mailto:' + emailAddress + '?subject=Re:' + current.sysapproval.number + ' ' + ' - reject&body=%0A%0A' + mark + '"style="color:white;font-size:16px;font-weight:bold;"' + link + '"> Reject</a></span>');

})(current, template, email, email_action, event);

 

Make sure to call this script in your mail body as: 

${mail_script:notifcation_email_script_name}

 

Kindly mark the answer ✔️Correct or Helpful ✔️If it addresses your concern.


Regards,

Siddhesh

 

 

 



Hi @Siddhesh Gawade 

Thanks for the response

the url which was mentioned in screenshot needs to be insert in the notififcation dynamically through email script , because , if it is in dev it needs to redirect to dev agileboard and if prod it redirects to Prod

Ramu6_0-1704425661575.png

Thanks

Ramu

 

var baseLink = gs.getProperty('glide.servlet.uri')
 template.print("<a href=" + baseLink + "incident_list.do?sysparm_clear_stack=true> Agileboard</a>");

Just use this code, in your email script, the first line will give you dynamic url based on you instance.

@Siddhesh Gawade 

Understood that , my concern was how should i place my agile board link instead of incident list in above code?

Thanks

Ramu