Notification additional comments

Amit_H
Tera Contributor

I have configured one email notification and added additional comments in email body. its working fine but it only showing latest 3 comments. I want to show all. How can i achieve it.

2 ACCEPTED SOLUTIONS

Runjay Patel
Giga Sage

Hi @Amit_H ,

 

Its OOB configuration. Put -1 to include all comments.

RunjayPatel_0-1738068363297.png

 

-------------------------------------------------------------------------

If you found my response helpful, please consider selecting "Accept as Solution" and marking it as "Helpful." This not only supports me but also benefits the community.


Regards
Runjay Patel - ServiceNow Solution Architect
YouTube: https://www.youtube.com/@RunjayP
LinkedIn: https://www.linkedin.com/in/runjay

-------------------------------------------------------------------------

 

View solution in original post

Dr Atul G- LNG
Tera Patron
Tera Patron

Hi @Amit_H 

 

Please change in email  properties

 

AGLearnNGrow_0-1738068607481.png

 

 

*************************************************************************************************************
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]

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

View solution in original post

4 REPLIES 4

Runjay Patel
Giga Sage

Hi @Amit_H ,

 

Its OOB configuration. Put -1 to include all comments.

RunjayPatel_0-1738068363297.png

 

-------------------------------------------------------------------------

If you found my response helpful, please consider selecting "Accept as Solution" and marking it as "Helpful." This not only supports me but also benefits the community.


Regards
Runjay Patel - ServiceNow Solution Architect
YouTube: https://www.youtube.com/@RunjayP
LinkedIn: https://www.linkedin.com/in/runjay

-------------------------------------------------------------------------

 

Dr Atul G- LNG
Tera Patron
Tera Patron

Hi @Amit_H 

 

Please change in email  properties

 

AGLearnNGrow_0-1738068607481.png

 

 

*************************************************************************************************************
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]

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

Ankur Bawiskar
Tera Patron
Tera Patron

@Amit_H 

If you wish to show all then I will recommend using email script and use this to print all comments.

I won't recommend changing the OOB system property as it would be global impact.

Then include that in email notification body as this

${mail_script:showComments}

(function runMailScript(current, template, email, email_action, event) {

    // Add your code here
	template.print('All comments are as below <br/>');
    var grJournal = new GlideRecord('sys_journal_field');
    grJournal.addQuery('element_id', current.sys_id);
    grJournal.addQuery('element', 'comments');
    grJournal.orderByDesc('sys_created_on');
    grJournal.setLimit(1);
    grJournal.query();
    if (grJournal.next()) {
        template.print(grJournal.value.toString() + "<br/>");
    }

})(current, template, email, email_action, event);

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

@Amit_H 

Thank you for marking my response as helpful.

As per new community feature you can mark multiple responses as correct.

If my response helped please mark it correct as well so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader