Find your people. Pick a challenge. Ship something real. The CreatorCon Hackathon is coming to the Community Pavilion for one epic night. Every skill level, every role welcome. Join us on May 5th and learn more here.

comments in notification

avinashdube
Tera Guru

Hi , i  have a  notification that  with below code :

Short description: ${short_description}
Item: ${cat_item}
 
Click here to view request item: ${URI_REF}

${mail_script:attach_links}
Comments:
${comments}

I am not able to understand why it is printing all the comments on the RITM , instead of printing the latest comment only .


ss:


 
avinashdubey103_0-1707375434268.png

 

1 ACCEPTED SOLUTION

SanketLandge1
Kilo Guru

Hello @avinashdube 

 

System Properties >> Mail Properties

 

Change the number to 1. It would mean platform wide any notification sent for comments.

 

If you want it to be specific for a table you need mail script & use current.comments.getJournalEntry(1); & then use the mail script in notifications.

find_real_file.png

Change the number to 1. It would mean platform wide any notification sent for comments.

 

If you want it to be specific for a table you need mail script & use current.comments.getJournalEntry(1); & then use the mail script in notifications.

 

View solution in original post

9 REPLIES 9

Harish KM
Kilo Patron

Hi @avinashdube $comments will print all the comments from that record, If you want latest comments then have a email script with line

var comments = current.comments.getJournalEntry(1).split('\n')[1]; // for latest comments

template.print(comments);

call the above script in your Notification using ${mail_script:scriptName}

Regards
Harish

hello @avinashdube 

 

Mail Scritp and than call it to notification

 

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

var latestcommentsare = current.comments.getJournalEntry(1);
template.print(latestcommentsare);

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

Hi @avinashdube just so you know changing the property will impact for all the tables,

Regards
Harish

SanketLandge1
Kilo Guru

Hello @avinashdube 

 

System Properties >> Mail Properties

 

Change the number to 1. It would mean platform wide any notification sent for comments.

 

If you want it to be specific for a table you need mail script & use current.comments.getJournalEntry(1); & then use the mail script in notifications.

find_real_file.png

Change the number to 1. It would mean platform wide any notification sent for comments.

 

If you want it to be specific for a table you need mail script & use current.comments.getJournalEntry(1); & then use the mail script in notifications.