- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-16-2023 11:10 PM
Hi Community,
I have this email script which is pulling affected products in the notification.
var gr = new GlideRecord("m2m_kb_ci");
gr.addQuery("kb_knowledge", current.sys_id);
gr.query();
while (gr.next()) {
template.print(gr.getDisplayValue('cmdb_ci'));
}
Currently its printing abcxyz. I want to have comma separated values as abc,xyz.
I tried to split it but nothing worked.
Kindly help me in this.
Thanks,
Poorva Bhawsar
Solved! Go to Solution.
- Labels:
-
Incident Management
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-16-2023 11:21 PM
Please try below code, declare one array and push cmdb_ci value on that.
var arr=[];
var gr = new GlideRecord("m2m_kb_ci");
gr.addQuery("kb_knowledge",current.sys_id);
gr.query();
while(gr.next()) {
var num=gr.getDisplayValue('cmdb_ci');
arr.push(num);
}
template.print(arr);
Please check and Mark Helpful and Correct if it really helps you.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-16-2023 11:21 PM
Please try below code, declare one array and push cmdb_ci value on that.
var arr=[];
var gr = new GlideRecord("m2m_kb_ci");
gr.addQuery("kb_knowledge",current.sys_id);
gr.query();
while(gr.next()) {
var num=gr.getDisplayValue('cmdb_ci');
arr.push(num);
}
template.print(arr);
Please check and Mark Helpful and Correct if it really helps you.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-16-2023 11:35 PM
Yes that worked for me... Thanks... 🙂
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-16-2023 11:40 PM
That's Great!! Please mark Helpful also!!