- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-27-2024 12:09 PM
Hi,
if a Problem Task is assigned to my group, I would like the system to send all group members an email notification.
I created a notification below,
Reported by: ${sys_created_by}
Number: ${number}
Assignment group: ${assignment_group}
Assigned to: ${assigned_to}
Priority: ${priority}
Short Description
Created Date(Don't include time): ${mail_script:date_without_time}
Not able to find a field for short description and created date without time. Can anyone help to solve this?
Preview mail:
Thank you
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-27-2024 02:04 PM
Hi @JulietD,
There is a field called short_description on the Problem Task record which you can use.
And, you can use the following email script to get the created date without time.
Name: date_without_time
(function runMailScript(/* GlideRecord */ current, /* TemplatePrinter */ template,
/* Optional EmailOutbound */ email, /* Optional GlideRecord */ email_action,
/* Optional GlideRecord */ event) {
var gdt = new GlideDateTime(current.getValue('sys_created_on'));
var date = gdt.getDate();
template.print(date);
})(current, template, email, email_action, event);
Email notification:
Reported by: ${sys_created_by}
Number: ${number}
Assignment group: ${assignment_group}
Assigned to: ${assigned_to}
Priority: ${priority}
Short Description: ${short_description}
Created Date(Don't include time): ${mail_script:date_without_time}
Outcome:
Cheers
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-27-2024 12:21 PM
Hi @JulietD
I tested in my PDI and i can see this.
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.
Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]
****************************************************************************************************************
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-27-2024 12:30 PM
Hi there @JulietD
By adding ${short_description} to your email template, you'll include the short description of the problem task. As for the created date without time, you may need to use a script include or a BR to extract this information and make it available as a variable in your email template. Once available, you can reference it using ${mail_script:date_without_time}.
If this helps kindly accept the answer thanks much.
Kind Regards,
Mohamed Azarudeen Z
Developer @ KPMG
Microsoft MVP (AI Services), India
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-27-2024 02:04 PM
Hi @JulietD,
There is a field called short_description on the Problem Task record which you can use.
And, you can use the following email script to get the created date without time.
Name: date_without_time
(function runMailScript(/* GlideRecord */ current, /* TemplatePrinter */ template,
/* Optional EmailOutbound */ email, /* Optional GlideRecord */ email_action,
/* Optional GlideRecord */ event) {
var gdt = new GlideDateTime(current.getValue('sys_created_on'));
var date = gdt.getDate();
template.print(date);
})(current, template, email, email_action, event);
Email notification:
Reported by: ${sys_created_by}
Number: ${number}
Assignment group: ${assignment_group}
Assigned to: ${assigned_to}
Priority: ${priority}
Short Description: ${short_description}
Created Date(Don't include time): ${mail_script:date_without_time}
Outcome:
Cheers
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-28-2024 01:11 AM
Thank you soo much