We've updated the ServiceNow Community Code of Conduct, adding guidelines around AI usage, professionalism, and content violations. Read more

How to remove line from comments added in the ritm IT IS COMMING ON notification

avinashdube
Tera Guru

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 :

template.print("<br> <br> <strong> Additional Comments:</strong> <br> <br> ${comments} <br> <strong> Click here to view request item </strong> <a style='color: #324450;'href='" + reqUrl + "'>${number}</a> <br> <br> </div><div style='height:30px;'>&nbsp;</div> <td style='width: 30px;'>&nbsp;</td></td> </tr> </tbody> </table> </td> <td style='width: 20%; background: white; border-bottom: white solid 5px;'></td> </tr> <tr id='footerRow'> <td style='width: 100%; height: 30px; background: white;' colspan='3'></td> </tr> <tr id='infoFooter'><td style='width: 20%; background: white; '></td> <td style='width: 60%; background: white; '> </td> <td style='width: 20%; background: white; '></td> </tr><tr id='footerRow1' style='background: white;'><td style='width: 20%; border-bottom: none;'></td> <td style='width: 60%; none;'><img src='" + FooterUrl + "'> </img></td></tr> </tbody>  </table></body></html>  </tbody>  </table></body></html> </tbody> </table></body></html>");


output :
avinashdubey103_0-1706789738479.png

 



2 REPLIES 2

ASA5
Mega Sage

@avinashdube 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(...

Dr Atul G- LNG
Tera Patron

@avinashdube 

 

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.

*************************************************************************************************************
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/dratulgrover [ Connect for 1-1 Session]

****************************************************************************************************************