Adding custom mailto link in the change approval email template, change.itil.approve.role

Rohini7
Kilo Contributor

Hi All,

 

I have been working on change process where we have added custom remediate option at the approval level. Where VP of the department have option to approve, reject and remediate (If they need more information). Below is the wiki that I have used in order to add our custom option.

 

http://wiki.servicenow.com/index.php?title=Custom_Transitions_for_the_Approval_-_User_Activity

 

The logic with in the workflow is working fine. When I use my remediate UI action its working fine. But I am having issue defining email for the custom option. I just updated change.itil.approve.role template to add my new template. The template that I created is mailto.remediate.

 

Now my change.itil.approve.role looks as below. Which will show 3 links in the approval email.

<hr/>

${mailto:mailto.approval}

<hr/>

${mailto:mailto.rejection}

<hr/>

${mailto:mailto.remediate}

<hr/>

 

The issue I have here is when the VP clicks on remediate. Its not updating the Sysapproval_approver table with the new state. I went and checked to see if I may have to update Approval Events (Non-Task) and Approval Events (Task) event Business rule to add my condition remediated. Below is the case I added.

 

case 'remediated':

                updateRecord(current, current.approver.getDisplayValue() + " remediated the task.", current.comments);

                break;

 

Even after I made this change, remediate as VP via email its not working. I was thinking if have to have create some inbound action for this

 

If anyone has done something similar to this feel free to share the knowledge.

 

Thank you !

1 ACCEPTED SOLUTION

Chandan23
Tera Expert

You need to create a inbound email action to update the approval record accordingly.


View solution in original post

4 REPLIES 4

Chandan23
Tera Expert

You need to create a inbound email action to update the approval record accordingly.


Hi Chandan,



Thanks for Reply. I have done inbound actions before for the email replies. But this time I kind of wanted to try mailto option that they   have and see how that works. As for the approve and reject, they don't really have any inbound action on sys_approval_approver table. That's the reason I went this route. I was trying to see how it works for approve and reject now without the inbound action and adapt the same design for remediate option



Rohini


Ignore my earlier reply. I found Update Approval Request inbound action. I will try and add a condition there. May be that will work.



Thank !



Rohini


Updating "Update approval Request" inbound action worked. Just added the below code. As I have added "remediated" as one of the state choice list on sysapproval_approver table.



if (email.subject.indexOf("remediate") >= 0)


        current.state = "remediated";



Rohini