How to remove line from comments added in the ritm IT IS COMMING ON notification
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-01-2024 04:15 AM
Hi , i have a requirement to add comments in the notification i am using the {$comments) in notification and printing it but a line is comming before that , how can i remove that line or change the color of that line
code :
output :
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-01-2024 04:47 AM - edited 02-01-2024 04:54 AM
@avinashdubey103 There is no way to remove the line, however you can create a reusable email script to retrieve comments :
var gr = new GlideRecord('sys_journal_field');
gr.addQuery('element_id', current.sys_id);
gr.addQuery('element', 'comments');
gr.orderByDesc('sys_created_on');
gr.setLimit(1);
gr.query();
while (gr.next()){
var comment = {};
comment.date = gr.getDisplayValue('sys_created_on');
var usergr = new GlideRecord('sys_user');
usergr.addQuery('user_name', gr.sys_created_by);
usergr.query();
if (usergr.next()){
comment.user = usergr.getDisplayValue('name');
}
else {
comment.user = gr.sys_created_by;
}
// Comment
comment.text = gr.getDisplayValue('value');
// Push
comments.push(comment);
}
Then loop through comments to show them using template.print(...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-01-2024 04:52 AM
It's ootb and by design only. If it is not creating issue keep it like that, also this line differentiates between new n old as well.
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.
Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]
****************************************************************************************************************