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

manikorada
ServiceNow Employee
ServiceNow Employee

Kenneth,



You are generating the Event from the Change Workflow using 'Create Event' activity which means it thinks that the event was generated from the 'Change' record. Its always better to have you event and email running on same table.


That makes sense. So, how would I generate the event from a different table(Table A) when something happens on Table B?


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());


}


Mani kanta Korada



I'm going to try this out but I'm having a mailbox created so that I can actually test the approval functionality.