Pulling a field through from another table into a Notification email

davidreid
Kilo Contributor

Hello,

How would I pull a field through from one table into a notification template or email based on another table?

I'm trying to pull through the details of a Change Request (change_request table) and put them in an approval email template (sysapproval_approver table), and I'm not sure what the syntax would be to do this, I've tried various variations on ${table name.field name} but nothing seems to be working.

Any ideas?

1 ACCEPTED SOLUTION

Hi David,



Here you go, use the below. I've verified it works



var gr = new GlideRecord("change_request");


gr.get(current.document_id);


template.print("Start Date:" + gr.start_date + '<BR>');


template.print("End Date:" + gr.end_date);


View solution in original post

17 REPLIES 17

It's not - the fields I need to pull through are in the change_request table into an approval template based around sysapproval_approver, I need to pull through the specific details of a change request so that people can approve it based on that information.


Hi David,



If the approver is generated from the change table and if the field exists in the table, then this should have worked for you..




Please tell me name of the field and the table the approval is generated from?


The approval process comes from our change management process, a change is logged and when it reaches the assessment stage it fires off a notification email to the approval cab group. The template for this email is based on the Approval (sysapproval_approver) table, the name of the template is change.itil.approve.role. I wish to bring fields in from the Change Request table to this template (change_request). So an example of the fields I wish to import are as below....



Comments and Work notes:



${comments_and_work_notes}



Planning:



Justification: ${justification}



Implementation plan: ${implementation_plan}



Risk and impact analysis: ${risk_impact_analysis}



Backout plan: ${backout_plan}



Test plan: ${test_plan}



Additional Details:



All Sites Affected: ${u_all_sites_affected}



Sites Affected: ${u_sites_affected}



Environment: ${u_environment}



What tests have been carried out prior to implementation?: ${u_tests_prior_implementation}



Are there any dependencies on other changes?: ${u_change_other_dependent}



Is the change focused on perimeter/DMZ based services?: ${u_change_focused}



Is the activity focused on the installation of a new appliance/service?: ${u_change_appliance_service}



Is there significant functional change in an existing appliance/service?: ${u_change_existing_service}



Communication Plan: ${u_communication_plan}



Is the request related to an incident?: ${u_related_incident}



Why is this an emergency change?: ${u_emergency_change_reason}