Implementing Actionable Email Approvals for Certificate Tasks via Inbound Actions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 hours ago
Requirement-
For Certificate Management, renewal of certificates, I need to create a notification to the managers of the assignment group of the CERT task for their approval in table Certificate Manual tasks(sn_disco_certmgmt_certificate_task) .
I need to design this using notification and inbound email action. For Notification I have configured-
Notification
Target Table- sn_disco_certmgmt_certificate_task
When to Send
1. Send When- Record Inserted or Updated
2. Condition- Certificate task type is Renewal AND Assignment group. Manager is not empty
Who will receive
Assignment Group.Manager
What it will contain
1.Template is empty
2.Subject- CERT TASK APPROVAL | ${number}
3.HTML Body-
<p>Hello ${assignment_group.manager.name},</p>
<p>A certificate task requires your approval.</p>
<p><strong>Task:</strong> ${number}<br><strong>Certificate:</strong> ${certificate.name}<br><strong>Expires On:</strong> ${certificate.expiration_date}</p>
<hr>
<p><a href="mailto:${assignment_group.manager.email}?subject=APPROVE_CERT ${number}"> ✔ Approve </a> <a href="mailto:${assignment_group.manager.email}?subject=REJECT_CERT ${number}"> ✖ Reject </a></p>
___________________________________________________
Inbound Action
Target Table - sn_disco_certmgmt_certificate_task
Action Type- Record Action
When to Run
Type- Reply
Condition- Subject contains approve or reject
Action Script
// current = certificate task record (auto-set by ServiceNow)
if (email.subject.indexOf('APPROVE_CERT') > -1) {
current.approval = 'approved';
current.comments = 'Approved via email by ' + email.from;
}
if (email.subject.indexOf('REJECT_CERT') > -1) {
current.approval = 'rejected';
current.comments = 'Rejected via email by ' + email.from;
}
current.update();
The email is getting triggered and when I am clicking on approve or reject, it is not changing the values for Approval in the CERT task, I believe there is some hinderance in handshake between the inbound action and the notification which I am unable to pinpoint.
