- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-18-2024 02:46 PM
Hi, I have a custom notification that goes out to the "requested for" when the request is closed. In the request, seven variables are displayed one at a time based on another variable selection. The displayed variables are controlled by catalog UI policies and are only viewable on tasks. I need to have that random variable captured by the notification and sent to the "requested for" once the request is closed. Any help would be great, thank you.
Notification message:
"Please select your MUV access." is a select box with seven options viewable all.
"Please select the correct AD group based on access requested/given:" is a label with seven checkboxes only viewable to one group on the task level.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-22-2024 08:50 PM
Try with below logic inside the mail script :
var ritmGr = new GlideRecord('sc_req_item');
ritmGr.addQuery('sys_id', current.sys_id);
ritmGr.query();
if (ritmGr.next()) {
var num1 = ritmGr.variables.muv_selectbox_access.getDisplayValue();
template.print("test: "+num1);
}
Thanks and Regards
Amit Verma
Please mark this response as correct and helpful if it assisted you with your question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-18-2024 03:18 PM
Hi @Bradley Bush ,
You can write email script and reach the variables from RITM and prepare email body output.
Browse some of existing email script for reference.
-Thanks,
AshishKM
Please mark this response as correct and helpful if it helps you can mark more that one reply as accepted solution
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-18-2024 09:20 PM
You can access the RITM variables via Email Scripts and call them inside your notification to render the variable values. Refer below post :
Thanks and Regards
Amit Verma
Please mark this response as correct and helpful if it assisted you with your question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-22-2024 01:32 PM
Hi, thank you Ashish and Amit for the helpful script reference. I did write a script and can get the "text" to display in the notification, the variable will not display though. I tried a few different ways and checked the HTML for the notification, but still no success. Any script help would be great, I seem to be stuck for now.
(function runMailScript( /* GlideRecord */ current, /* TemplatePrinter */ template,
/* Optional EmailOutbound */
email, /* Optional GlideRecord */ email_action,
/* Optional GlideRecord */
event) {
// Add your code here
var num1 = current.variables.muv_selectbox_access.getdisplayvalue();
template.print("test: "+num1);
})(current, template, email, email_action, event);
After this runs I get "You have been granted test: undefined."
thank you
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-22-2024 08:50 PM
Try with below logic inside the mail script :
var ritmGr = new GlideRecord('sc_req_item');
ritmGr.addQuery('sys_id', current.sys_id);
ritmGr.query();
if (ritmGr.next()) {
var num1 = ritmGr.variables.muv_selectbox_access.getDisplayValue();
template.print("test: "+num1);
}
Thanks and Regards
Amit Verma
Please mark this response as correct and helpful if it assisted you with your question.