- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-05-2013 09:17 AM
I have a notification called "More Information Needed" where I am attempting to email the u_submitted_by person that more information is needed on their Change Request when the approving manager changes the approval state to More Information Required which I added and is working. The notification information is below. My only issue here is that, since the notification is on the sysapproval_approver table with condition "State is More Information Required," I can't get the Change Request information in the body of the email NOR put u_submittted_by as the "who will receive" person. I've put the code below directly in the notification, but it keeps printing the code instead of the Change information.
NOTIFICATION:
Table: sysapproval_approver
Condition: State IS More Information Required
Subject: More information is required on......I would like to put the Change Request number here
Send when record inserted or updated; Inserted and Updated are true
Weight: 0
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-07-2013 12:34 AM
That could be a little tricky because of where the field is in the table hierarchy. Is the u_submitted_by field on the Task or Change Request table? I'm assuming it is not on the Task table, otherwise you would be able to see it when you expand the "Approval for" field in the list:
I thought you could use a setting described here to allow the fields from the Change table to also appear -
http://wiki.servicenow.com/index.php?title=Personalizing_Lists#Adding_Extended_Fields_to_Base_Table_Lists. Unfortunately that does not work with that particular field type.
However, there is a trick you can use, by running the following Background Script to force that field in:
Note - be very careful when running Background Scripts as you can really mess things up if you are not careful.
(function(){
var gr = new GlideRecord("sysevent_email_action");
if (gr.get("sys_id of your email notification")) {
gr.recipient_fields = "sysapproval.ref_change_request.u_submitted_by";
gr.update();
}
})();
I tried it in demo022 and it works. The trick is the "ref_" before the "change_request" table name, telling the system the field is not on the Task table (sysapproval is a reference field to Task), but on the Change Request extended table.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-05-2013 10:40 AM
You can dot-walk to the appropriate field. In your case, you should be able to use:
More information is required on ${sysapproval.number}
...in the Subject field.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-05-2013 11:15 AM
Jim - Thank you for the information. It works! Do you know how I would tell the "who will receive" on the notification to be the Change Request's u_submitted_by person since the notification is using the approval table?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-07-2013 12:34 AM
That could be a little tricky because of where the field is in the table hierarchy. Is the u_submitted_by field on the Task or Change Request table? I'm assuming it is not on the Task table, otherwise you would be able to see it when you expand the "Approval for" field in the list:
I thought you could use a setting described here to allow the fields from the Change table to also appear -
http://wiki.servicenow.com/index.php?title=Personalizing_Lists#Adding_Extended_Fields_to_Base_Table_Lists. Unfortunately that does not work with that particular field type.
However, there is a trick you can use, by running the following Background Script to force that field in:
Note - be very careful when running Background Scripts as you can really mess things up if you are not careful.
(function(){
var gr = new GlideRecord("sysevent_email_action");
if (gr.get("sys_id of your email notification")) {
gr.recipient_fields = "sysapproval.ref_change_request.u_submitted_by";
gr.update();
}
})();
I tried it in demo022 and it works. The trick is the "ref_" before the "change_request" table name, telling the system the field is not on the Task table (sysapproval is a reference field to Task), but on the Change Request extended table.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-10-2013 08:54 AM
Jim - The u_submitted_by field is on the Change Request table. Your script worked perfectly and the notification is now going to the submitter just as needed. Thank you very much for your help! I really appreciate it.