Approval view link in email notification

greggszul
Tera Expert

Dear Colleagues,

I'm preparing some notifications and what I wan to include in them is link to approval view for approvers, so they can easily reach the ticket and approve/reject from there.

I've tried ${sysapproval.URI_REF} however it is not working, nothing gets printed to the notification.

I've tried to build a script which will create a link for me:

function CreateLinkForObject(strTableName, strSysID){

    return "<a href=" + gs.getProperty('glide.servlet.uri') + gs.generateURL(strTableName, strSysID) + ">Click here to view the ticket</a>";

}

var gr = new GlideRecord("sysapproval_approver");

gr.addQuery("sysapproval", current.sys_id);

gr.query();

if(gr.next()) {

  template.print(CreateLinkForObject("sysapproval_approver", gr.sys_id.toString()));

}

Script is working however the problem is that when I have more than one approver the script cannot distinguish the person.

Are there any ways to tell to whom specifically certain email was sent ? OR maybe there is some way to enable ${sysapproval.URI_REF} ?

I would greatly appreciate any fedback.

Thank you.

1 ACCEPTED SOLUTION

HI,



Thank you for the clarification of the use case. I ran in to this as a customer many many years ago. Last year I came up with this solution using a scheduled job. I added some 'scriptless' capabilities to make it easy to configure since it is avery common use case.



Scriptless scheduled jobs


View solution in original post

9 REPLIES 9

Chuck Tomasi
Tera Patron

A couple questions...



What table is the notification being generated from? Is it Approver (sysapproval_approver)?



Specifically, what do you want to link to when they click the link? The approval record itself or the "thing" you are approving?


Hi Chuck,




Thank you for fast reply.


It's working on "sysapproval_approver" table. I want to show the approval record for specific approver, so he/she can approve easily.


In that case, you would just use ${URI} or ${URI_REF} in the message text to link to the approval record.


When I'm using this I'm still getting redirected to the RITM itself.