Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Scriptrunner French charters not rendered in email subject

Hello,

I currently have and issue with Jira - 7.13.5 and Scriptrunner - 5.5.6

I've created a listners that send an email on a issue update for a given value.

If I place the script in the in line dialoge box the French characters in the subject line are displayed correctly.

If I run the script as a file the French characters are returned as instantané instead of instantané.  

I've tried changing the é to é and this results in é  being displayed in the subject line.

I've been through the trouble shooting guide for French charaters and our db and setting are utf-8.

I've include a code snippet of what we have. 

def String subjectSTR = " instantané " + issue.getKey(); 
sendEmail (NominatorEmail.toString(), subjectSTR.toString(), bodyEmail.toString());

def sendEmail(String recipients, String subject, String body) {
SMTPMailServer mailServer = ComponentAccessor.getMailServerManager().getDefaultSMTPMailServer();
if (mailServer && recipients) {
Email email = new Email(recipients);
email.setMimeType("text/html");
email.setSubject(subject);
email.setBody(body);
mailServer.send(email);
} else {
// Problem getting the mail server from JIRA configuration, log this error
}
};

 Any help would be appreciated.

Thanks.

1 answer

0 votes
Antoine Berry Community Leader Sep 05, 2019

Hi @Neil Dixon ,

I do send mail in french and characters are correctly parsed. I would first advise to check that your scripts are encoded in UTF-8. I use a similar method except I am using 

MimeBodyPart mailBodyPart = new MimeBodyPart()
mailBodyPart.setText(content, "UTF-8", "html")
MimeMultipart multipart = new MimeMultipart("mixed");
multipart.addBodyPart(mailBodyPart)
email.setMultipart(multipart);

instead of 

email.setMimeType("text/html")

Also this allows me to add attachments.

Hope that can fix your issue.

Antoine

Antoine Berry Community Leader Sep 11, 2019

Hi @Neil Dixon ,

Did you notice any improvement ?

Hi @Antoine Berry 

The body of the emails are displaying fine.  The subject line still doesn't display the characters correctly.

If you have any suggestions let me know.

Thanks again.

Neil

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Marketplace Apps & Integrations

5 mobile apps for Jira Cloud to boost productivity

  It’s very important to have access to the workflow process from anywhere. Especially if you manage the work of others. There is no difference whether you’re out of office, or drive a ca...

216 views 2 5
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you