Implementing Actionable Email Approvals for Certificate Tasks via Inbound Actions

kartikay03
Tera Contributor

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> &nbsp;&nbsp; <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.

 

kartikay03_0-1769551415331.pngkartikay03_1-1769551430974.pngkartikay03_2-1769551449732.pngkartikay03_3-1769551522330.pngkartikay03_4-1769551535130.pngkartikay03_5-1769551555069.png

 

1 REPLY 1

Mark Manders
Mega Patron

What do the email logs say? Is the email handled by the inbound action? If so, does the person emailing in have the correct roles to update the ticket? Even through email you need to have write permission to update a record. 

Did you also check any possible update issues of the field itself? Is this supposed to be updated on the field itself, or are there, in fact, approval records for this and do you need to approve those to update the field?


Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark