
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-05-2019 07:23 AM
Hello,
I am working on updating the approval request email notification that goes out to the relevant approver. This particular version is used for Service Catalogue items.
I am currently unable to dot walk from the [sysapproval_approver] table to get the name of the person the catalogue item has been ordered on behalf of. I can easily get who opened the request, but I need the name of the user in the 'Request For' part of the request.
This is currently causing an issue where approvers are being asked to approve requests for the person who opens the ticket, and not who the item is for.
Can anyone please assist?
Thanks in advance
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-05-2019 07:54 AM
Change the above script to below:
var result; //**
var gr = new GlideRecord('sysapproval_approver');
gr.addQuery('sysapproval', current.sys_id);
gr.query();
if(gr.next()){
result = gr.sysapproval.request.requested_for.getDisplayValue();
template.print(result);
}
Please mark my response as correct and helpful if it helped solved your question.
-Thanks

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-05-2019 08:34 AM
Thanks Prateek! Whilst that works, I adapted your answer to add it within the notification itself, without the need for the email script.
${sysapproval.request.requested_for}
This worked like a charm. Thank you for you help 🙂
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-05-2019 07:37 AM
You can write a email script to pull the values
var result; //**
var gr = new GlideRecord('sysapproval_approver');
gr.addQuery('sysapproval', current.sys_id);
gr.query();
if(gr.next()){
result = gr.sysapproval.variables.Your_requested_for_variable_name;
template.print(result);
}
Please mark my response as correct and helpful if it helped solved your question.
-Thanks

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-05-2019 07:48 AM
Thanks for your quick response, Prateek.
I can get the variable data easily - I use the variable 'business justification' in the email body. Whilst there is a requested for variable on the catalogue item, not all items use this. I need to reference the actual field within the actual REQXXXXXXX to ensure I can provide the most robust information.
I hope this makes sense
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-05-2019 07:54 AM
Change the above script to below:
var result; //**
var gr = new GlideRecord('sysapproval_approver');
gr.addQuery('sysapproval', current.sys_id);
gr.query();
if(gr.next()){
result = gr.sysapproval.request.requested_for.getDisplayValue();
template.print(result);
}
Please mark my response as correct and helpful if it helped solved your question.
-Thanks

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-05-2019 08:34 AM
Thanks Prateek! Whilst that works, I adapted your answer to add it within the notification itself, without the need for the email script.
${sysapproval.request.requested_for}
This worked like a charm. Thank you for you help 🙂