- 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 01:06 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-10-2022 01:04 PM
Try the below code to print the link:
known_error_field_name -- Filed name for the known error number field, asssuming it to be on problem record
var known_error = ''+current.sysapproval.known_error_field_name;
var known_error_number = ''+current.sysapproval.known_error_field_name.getDisplayValue();
var link = "/kb_template_faq.do?sys_id="+known_error;
var kb_link = "<a href='" + link +"'>" + known_error_number+ "</a>";
template.print("Known error : " + kb_link+ "<br/>");
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-10-2022 01:14 PM
- 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 01:18 PM
yes it is working now thank you so much for your time