The CreatorCon Call for Content is officially open! Get started here.

How to display the business elapsed percentage of SLA as round number in email notification

Arjun Reddy Yer
Tera Guru

Can anyone help me @Ankur Bawiskar @Vasantharajan N @Pradeep Sharma 

 

As I need to display the business elapsed percentage of SLA results as Round number in the SLA Email Notification.

Currently it's triggering as mentioned in the below screen shot

ArjunReddyYer_1-1692943528535.png

So I need to display the business elapsed percentage of SLA as 50% only not 50.11% in the Email Notification.

As currently I had configured the Email Notification as mentioned in below screen shot

ArjunReddyYer_2-1692943674308.png

 

 

1 ACCEPTED SOLUTION

@Arjun Reddy Yer - Please include '%' after you do round of in the subject. I've highlighted where you need to include.

Math.round(current.business_percentage) + "%"

VasantharajanN_0-1692965994242.png

 

For your reference

VasantharajanN_1-1692966369621.png

Result

VasantharajanN_0-1692966343931.png

 


Thanks & Regards,
Vasanth

View solution in original post

13 REPLIES 13

Tried with below mentioned script but in the subject line "%" symbol is not getting displayed only in email body is getting displayed

Output:

ArjunReddyYer_0-1692965052278.png

Script:

ArjunReddyYer_1-1692965095250.png

 

@Arjun Reddy Yer - Please include '%' after you do round of in the subject. I've highlighted where you need to include.

Math.round(current.business_percentage) + "%"

VasantharajanN_0-1692965994242.png

 

For your reference

VasantharajanN_1-1692966369621.png

Result

VasantharajanN_0-1692966343931.png

 


Thanks & Regards,
Vasanth

@Arjun Reddy Yer - If your ask is answered, Please mark appropriate response as answer to help future readers. 


Thanks & Regards,
Vasanth

Jaspal Singh
Mega Patron
Mega Patron

Hi Arjun,

 

Please create a mail script named: roundofbusinesselapsed as below

 

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

    // Add your code here
    var roundingoff = current.business_percentage.split('%')[0];
    template.print(Math.round(roundingoff));

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

 

 

Call the mail script: ${mail_script:roundofbusinesselapsed}