- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-15-2016 03:20 AM
Hi All,
I created an email notification to be issued from Problem table, however I am struggling to pull all problem tasks related to that problem. In other words, I would like to send email notification informing about the problem record with all of it's problem task record. Problem task records must include number, short description, assignment group and a due date.
This seems like something that a lot of user would probably want to issue and kind of a common sense, but it does not seem to be built in to ServiceNow. I found some examples regarding email scripts or database views, but none are tailoring to this simple quest.
Does anyone have any suggestions how I could achieve pulling all related problem tasks to a problem record email notification or possibly done something similar previously?
Any thoughts and suggestions are much appreciated!
Kind Regards,
Kamile
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-15-2016 03:50 AM
Hi Kamile,
Email Script with GlideRecord on Problem task should do the job.
Basically,
Create a Notification script and add below code to pull the information of related problem tasks with something like below.
var gr=new GlideRecord('problem_task')
gr.addQuery('problem', current.sys_id);
gr.query();
while(gr.next()){
template.print("number:" gr.getValue('number'));
template.print("short_description", gr.getvalue('short_description'));
}
Hope this helps
Srini
Mark this response as helpful/correct if it does so
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-15-2016 03:50 AM
Hi Kamile,
Email Script with GlideRecord on Problem task should do the job.
Basically,
Create a Notification script and add below code to pull the information of related problem tasks with something like below.
var gr=new GlideRecord('problem_task')
gr.addQuery('problem', current.sys_id);
gr.query();
while(gr.next()){
template.print("number:" gr.getValue('number'));
template.print("short_description", gr.getvalue('short_description'));
}
Hope this helps
Srini
Mark this response as helpful/correct if it does so
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-15-2016 08:08 AM
Hi Srinivas,
Unfortunately, this doesn't work. I had a very similar script but neither yours nor mine worked..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-15-2016 08:20 AM
Actually I got it working with my own script somehow just now! Thank you for the help
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-22-2016 10:57 AM
kamile - can you post your script? I'm trying to do something similar and haven't been successful.