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

Is this an OOB approval email? Details about the notification record and/or screenshots would be helpful. I'd like to know if this is generated from an event or record insert/update and all the other little goodies about how this thing came in to being and what it's trying to do. I'm sure the answer is in there somewhere.


Hi Chuck,



Here s my notification configuration:


Awaiting approval notif.png


This is a notification which is sent after event is fired. The event is in the triggered by the Workflow. The main purpose of this notification is to send a reminder for approvers. The main reason why this is not working is that this notification is sent to many users at once, so the platform cannot distinguish them. Maybe there are better ways to send reminders ?



Thank you


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


Hi Chuck,



Thank you very much.


You are very welcome.