- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-05-2020 11:00 PM
Hi All,
I am triggering event from server script in a widget. I am passing some value in parm2. Now I need to get that parm2 value as a part of my email notification body.
How can I get that? Please help anyone.
One more thing is I have two template.print() in my mail script. I have two different values. I need those two values in my notification.
//below is my mail script
var test = new GlideRecord("test");
test.addQuery('name', 'true');
test.query();
if (test.next()) {
template.print(test.getDisplayValue("number"));
template.print(test.getDisplayValue("date"));
}
//below is my notification body
name: ${mail_script:getname}
below is date:
date: ${mail_script:getname}
Now I am calling my mail script two times in notification. So in the name I need first template.print() value and in the date I need second template.print() value.
How can I get that? Please help.
Solved! Go to Solution.
- Labels:
-
Incident Management

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-07-2020 04:48 PM
var parm = event.parm2;
use parm where you want to in EMail script
if you want to use directly on notification then use ${event.parm2}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-07-2020 04:48 PM
var parm = event.parm2;
use parm where you want to in EMail script
if you want to use directly on notification then use ${event.parm2}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-07-2020 05:54 PM
Hi vennela
You should be able to use ${event.parm2} to get whatever is captured in your parameter2 from your event.
refer the following thread it similar
If it help mark helpful or correct
Thanks and regards
Anil

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-07-2020 06:00 PM
Hello,
The mail script when called, calls ALL template.print() within.
So you'd want to format that one mail script to account for either the entire message...or...make another mail script for the next line.
As far as how to use parm2, see Mike's response above.
Please mark reply as Helpful/Correct, if applicable. Thanks!
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-12-2020 02:17 PM
Hi,
It's been a bit since my reply was posted. I just wanted to check-in and see how things are going.
If my reply helped guide you correctly, please mark it as Helpful & Correct.
Thanks!
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!