- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-21-2017 11:30 PM
Hi
I have email script as follows
<mail_script>
var item = new GlideRecord("sc_req_item");
item.addQuery("request", current.sys_id);
item.query();
while(item.next()) {
var catalogItem = item.number + ': ' + item.cat_item.getDisplayValue();
var misc = item.variable_pool.alt_poc;
template.print(catalogItem + "<br/> Field: " + misc);
}
</mail_script>
I need to call this script in notifications, please help me out how can i do this?? with example or screen shot.
Any help is greatly appreciated (with examples)
--venky
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-21-2017 11:35 PM
Hello Venkatesh
Create mail scripts in System Policy > Email > Notification Email Script->
(function runMailScript(current, template, email, email_action, event) {
var item = new GlideRecord("sc_req_item");
item.addQuery("request", current.sys_id);
item.query();
while(item.next()) {
var catalogItem = item.number + ': ' + item.cat_item.getDisplayValue();
var misc = item.variable_pool.alt_poc;
template.print(catalogItem + "<br/> Field: " + misc);
}
})(current, template, email, email_action, event);
Now you can call the above mail script in email notification(Message HTML) as ${mail_script:script name}
Here replace script name with the exact name of the notification email script you have created in step 1.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-21-2017 11:35 PM
Hello Venkatesh
Create mail scripts in System Policy > Email > Notification Email Script->
(function runMailScript(current, template, email, email_action, event) {
var item = new GlideRecord("sc_req_item");
item.addQuery("request", current.sys_id);
item.query();
while(item.next()) {
var catalogItem = item.number + ': ' + item.cat_item.getDisplayValue();
var misc = item.variable_pool.alt_poc;
template.print(catalogItem + "<br/> Field: " + misc);
}
})(current, template, email, email_action, event);
Now you can call the above mail script in email notification(Message HTML) as ${mail_script:script name}
Here replace script name with the exact name of the notification email script you have created in step 1.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-21-2017 11:36 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-22-2017 02:31 AM
hi pradeep,
i have a field calld mobile_number in catalog item.
but iam not getting data entered in that field, i am getting some "MSG00008" as a email.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-03-2019 05:45 AM
Hi Pradeep,
How can I add two different email scripts body into one email script?