comments in notification

avinashdubey103
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 @avinashdubey103 

 

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
Kilo Patron

Hi @avinashdubey103 $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 @avinashdubey103 

 

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 @avinashdubey103 just so you know changing the property will impact for all the tables,

Regards
Harish

SanketLandge1
Kilo Guru

Hello @avinashdubey103 

 

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.