- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-10-2022 11:48 AM
Hi Community,
In problem record i have created only one problem task and trying to display in the notification but it is showing all the notification from the problem task table.
I have written mail script to get these problem tasks.
Code:
var gr = new GlideRecord("problem_task");
gr.addQuery("problem_id", current.sys_id);
gr.query();
while(gr.next()) {
template.print(gr.getDisplayValue('number') + "<br>");
}
Any suggestions please.
Thanks,
Shrinivasprasad
Solved! Go to Solution.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-10-2022 01:16 PM
Made some edits to the code. Can you use the recent one. Also, use the exact field name for the known_error_field_name. I just used a variable name.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-10-2022 12:46 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-10-2022 11:57 AM
Hi
Assuming "current" is the problem GlideRecord.
You need to make one modification in your code, replace
gr.addQuery("problem_id", current.sys_id);
with
gr.addQuery("problem", ''+current.sys_id);
The field on the problem_task table that stores the reference to problem is "problem".
If it answers your question, please mark correct/helpful.
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-10-2022 12:24 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-10-2022 12:28 PM
Can you share some details of the notification? What is your "current"?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-10-2022 12:31 PM
It is on sysapproval table, before approval i am trying to add the problem task.
Please let me know if any details needed