URL in an Email notification to ESC view of an Approval Task

Linda6
Mega Guru

Dear community,

I'm struggling in finding out how to direct the users who receive an approval notifications to be directed to the ESC view of the approval instead to the backend.

I came across these two articles which were helpful:

URL in an Email notification to portal view of a HR Task 

How to set up email notifications to point to the Service Portal instead of the Platform UI 

 

However, my concern is that when the user clicks on the button to Take me to my Approval, it directs to the ESC, but only to the general view of the To-dos widget (hrm_todos_page), but not the specific approval task/request:

 

Where it directs now:

situationnow.png

 

Desired state would be to open directly the given approval request (in this case it is CHG0030195):

 

situationdesired.png

 

The email script I'm using is as follows:

 

 

 

(function runMailScript(/* GlideRecord */ current, /* TemplatePrinter */ template,
          /* Optional EmailOutbound */ email, /* Optional GlideRecord */ email_action,
          /* Optional GlideRecord */ event) {

	var url = '<a href="' + 'esc?id=hrm_todos_page&table=' + current.sys_class_name + '&sys_id=' + current.sys_id + '">Take me to the Approval</a>';

	//template.print("<a href= '"+ url + "'>" + current.number + "</a>"); 
	template.print(url);
		
})(current, template, email, email_action, event);

 

 

 

Can you please help me in correcting my script, so it would direct the user straight to the desired approve request?

 

Thank you and kind regards,

 

Linda

 

13 REPLIES 13

thanks.

jakeb25
Tera Contributor

Hi, I have the same requirement and these solutions are still getting me to the approvals page in general but not directly to the correct record.... what am I missing?

 

(function runMailScript(/* GlideRecord */ current, /* TemplatePrinter */ template,
          /* Optional EmailOutbound */ email, /* Optional GlideRecord */ email_action,
          /* Optional GlideRecord */ event) {

    var url = '<a href="' + '/esc?id=hrm_todos_page&table=sysapproval_approver&sys_id=" ' + current.sys_id + '">Take me to the Approval</a>';

    //template.print("<a href= '"+ url + "'>" + current.number + "</a>");
    template.print(url);
       
})(current, template, email, email_action, event);

Hi jakeb25,

Did you check out my post from Oct 27th?

"Not sure if you were able to figure this out  on your own, but I had similar requirements and I finally got it to work using the hrm_todo page and these parameters: ?id=hrm_todo&sysparm_tableName=sysapproval_approver&sys_id="

I did try that as well, no luck.