- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-09-2023 09:26 PM
Hello All,
I have a problem with approving/rejecting a Approval request using email notification.
When the 1st approver click the hyperlink "Click here to Approve/Reject", it will open and redirected to the approval form.
when the 2nd and 3rd approver click the same link, it will open and redirected to the approval form but under the 1st approver view or name.
Please help to check and correct my existing email script:
(function runMailScript( /* GlideRecord */ current, /* TemplatePrinter */ template,
/* Optional EmailOutbound */
email, /* Optional GlideRecord */ email_action,
/* Optional GlideRecord */
event) {
var baseURL = '';
baseURL = "https://" + gs.getProperty('instance_name') + ".service-now.com/sysapproval_approver.do?sys_id=" + current.sys_id;
template.print('<a style="font-family: verdana; font-size: 14px;color: blue;" href=' + baseURL + '>Click here to Approve/Reject</a><br />');
})(current, template, email, email_action, event);
The link should be open and redirected under for each approver not only under the 1st approver.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-09-2023 11:26 PM
your approval email notification should be on sysapproval_approver so that it sends 3 different emails for each of those 3 approver users
Condition: current.source_table == 'pm_project_task'
you can access the task fields using dot walking and show in email body
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-25-2023 01:14 AM
I don't think it would work
you are comparing number against sysId in this line
ptaskNumber.addQuery('task.number', current.sysid);
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-25-2023 03:04 PM
@Ankur Bawiskar , ahhh i think that's why im getting wrong displayValue.
let me re-work on the code.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-26-2023 08:12 PM
Sure.
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-29-2023 04:32 PM
Hello @Ankur Bawiskar can you please help how can i get the number of the current project task number based on my codes? It's displaying wrong value. Thank you
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-29-2023 06:50 PM
please share your latest code which you are using
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader