The CreatorCon Call for Content is officially open! Get started here.

Email Notification Target

Ken83
Mega Guru

Hello Community,

        I have created an event that gets fired via workflow activity in a workflow that is on the Change Request table. The event generates a notification that fires from the sysapproval_approver table. The notification contains a mail script that looks at the Change Request table to gather information and print it in the notification. I also attempted to create approve/reject links using the ${mailto:mailto.approval} and ${mailto:mailto.rejection} but they did not associate with a record. Therefore when I clicked the link that was generated, the email subject was simply -approve or -reject. So I had to custom create the approve and reject links and they operate as desired with one exception.

When the notification is fired, it contains all of the information I need. However, the Target shows the actual Change Request record. Therefore, when someone replies to the email notification using the links, it simply updates the Change Request activity log to show that someone replied.

2015-03-24 14_17_18-ServiceNow Service Automation - Internet Explorer.png

I need to modify the functionality so that the notification that I am generating will update the Change Request approval record when someone replies to the email instead of

just updating the Change Record.

1 ACCEPTED SOLUTION

manikorada
ServiceNow Employee
ServiceNow Employee

Kenneth,



Try to do a GlideRecord and then generate an event using Runscript.


Have a Runscript workflow activity and have a code something like:


var gr = new GlideRecord('sysapproval_approver');


gr.addQuery('sysapproval', current.sys_id);


gr.query();


if(gr.next())


{


gs.eventQueue('<<eventname>>',gr,gs.getUserName(), gs.getUserName());


}


View solution in original post

9 REPLIES 9

instead of creating an email through the workflow can you create it through email notifications and throw your mail script in there?


That's actually what I've done...sort of. Initially, the email notification was actually generated by a "Notification" workflow activity. I've since moved from that, to the "Generate Event" workflow activity which is triggering the notification now. With that configuration, is when I noticed the email responses were not working. Now i'm going to move to try Mani kanta Korada 's suggestion above.


Generating the event this way worked as far as indicating a Target for the notification. That has lead me to another problem. When a user replies back to the email, it is not pointing back to that same Target. The Target field on the received email shows (empty). Any suggestions on how to fix replies?


Nate23
Mega Guru

Kenneth,



The oob function triggers this inbound email action "Update Approval Request" . you can either use the oob function or copy the inbound email action to meet your custom approve and reject.



Hope this helps,


Nate


Nathan,



        This is what I'd hoped for but when replying to the email, the conditions did not match that inbound email action. Instead, it matched the "Update Change Request" email action. Without modifying those inbound actions, I was hoping to achieve my functionality above.