- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-29-2015 10:06 AM
Right now, what I have working is when a request is rejected by the approver, the workflow pushes out a notification to contact the admin of that process. This is helpful, but I would really like to add the reject reason to the message of the notification that is already being pushed out.
So the process going right now is pretty typical where the approve or reject email is sent to the approver and then they click reject, spawning a reply:
So, on the notification that goes out on the workflow, I want it to say something like "your request was rejected. Please contact Tina if you have any questions" followed by the reject reason (in this case "please correct dates").
Any ideas on how to get this inbound email to copy and paste to the notification?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-01-2015 09:08 AM
So this is actually composed of 3 parts for us as we have approvals at both the sc_request and sc_req_item levels.
1. Use a business rule to fire the correct events ( we are doing this so that we can notify the sysapproval.request.requested_for which is not an available field from the notifications)
Script:
function onBefore(current, previous) {
//This function will be automatically called when this rule is processed.
if(current.source_table == 'sc_request') {
if(current.state == 'approved') {
//gs.log('current.source_table/action: sc_request/approved');
gs.eventQueue("approval.req_approved", current, current.sysapproval.requested_for.sys_id, current.sysapproval.requested_for.name);
} else if(current.state == 'rejected') {
//gs.log('current.source_table/action: sc_request/rejected');
gs.eventQueue("approval.req_rejected", current, current.sysapproval.requested_for.sys_id, current.sysapproval.requested_for.name);
}
} else if (current.source_table == 'sc_req_item') {
if(current.state == 'approved') {
//gs.log('current.source_table/action: sc_req_item/approved');
gs.eventQueue("approval.ritm_approved", current, current.sysapproval.u_requested_for.sys_id, current.sysapproval.u_requested_for.name);
} else if(current.state == 'rejected') {
//gs.log('current.source_table/action: sc_req_item/rejected');
gs.eventQueue("approval.ritm_rejected", current, current.sysapproval.u_requested_for.sys_id, current.sysapproval.u_requested_for.name);
}
}
}
2. Configure each of the notifications
3. (Optional) we use mail scripts to format our email notifications into a basic template that is consistent across the board. Ours look like the below
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-01-2015 09:08 AM
So this is actually composed of 3 parts for us as we have approvals at both the sc_request and sc_req_item levels.
1. Use a business rule to fire the correct events ( we are doing this so that we can notify the sysapproval.request.requested_for which is not an available field from the notifications)
Script:
function onBefore(current, previous) {
//This function will be automatically called when this rule is processed.
if(current.source_table == 'sc_request') {
if(current.state == 'approved') {
//gs.log('current.source_table/action: sc_request/approved');
gs.eventQueue("approval.req_approved", current, current.sysapproval.requested_for.sys_id, current.sysapproval.requested_for.name);
} else if(current.state == 'rejected') {
//gs.log('current.source_table/action: sc_request/rejected');
gs.eventQueue("approval.req_rejected", current, current.sysapproval.requested_for.sys_id, current.sysapproval.requested_for.name);
}
} else if (current.source_table == 'sc_req_item') {
if(current.state == 'approved') {
//gs.log('current.source_table/action: sc_req_item/approved');
gs.eventQueue("approval.ritm_approved", current, current.sysapproval.u_requested_for.sys_id, current.sysapproval.u_requested_for.name);
} else if(current.state == 'rejected') {
//gs.log('current.source_table/action: sc_req_item/rejected');
gs.eventQueue("approval.ritm_rejected", current, current.sysapproval.u_requested_for.sys_id, current.sysapproval.u_requested_for.name);
}
}
}
2. Configure each of the notifications
3. (Optional) we use mail scripts to format our email notifications into a basic template that is consistent across the board. Ours look like the below
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-01-2015 10:17 AM
That was SUPER helpful! the business rule is what was wrong! I was trying to do it all on the notification so it was all going nowhere.
You are awesome! Thank you!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-11-2016 03:46 AM
Hi,
The same as above only difference is when sme one rejects the SR it shld show the single txt field which shld say enter the rejection reason.
Kindly help.
Regards,
Shristy Agrawal