- 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
‎09-22-2016 12:23 PM
Well nevermind, beat at it long enough and eventually it will work, right?
Here's my script for pulling active Issues from a notification triggered by a Status Report (PPM) in case anyone needs the reference:
var gr=new GlideRecord('issue');
gr.addQuery('parent', current.project);
gr.addQuery('active', true);
gr.orderBy('number');
gr.query();
while(gr.next()){
template.print(gr.number + " " + gr.short_description + "\n");
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-13-2018 04:32 AM
I would really like to see the script you made Kamila. Is it possible?
Regards Thomas