Groovy script with special characters

String currentUser = ((WorkflowContext) transientVars.get("context")).getCaller();
commmgr = (CommentManager) ComponentManager.getComponentInstanceOfType(CommentManager.class)
commmgr.create(issue, currentUser, "comment contain special charactes", true)
issue.store()

I have the above to create a comment in an issue after a transition.

The comment s text contain special characters like ñ or ó, but then in Jira they are displayed wrong. But if I typed them in jira they look OK.

What is the correct way to pass special characters in this case?

Thanks in advance,

2 answers

1 accepted

You may need to try representing the characters in a different way. Take a look at these for some examples:

http://www.javascripter.net/faq/mathsymbols.htm

http://www.digitalmediaminute.com/reference/entity/

0 votes
Henning Tietgens Community Champion Nov 13, 2013

You should take care that the encoding of the script file while editing is the same as the one used by JIRA and the underlying server. In our case it's all UTF-8. If you try the script from the console the comment should be added with the characters looking ok, right?

Suggest an answer

Log in or Join to answer
Community showcase
Sarah Schuster
Posted Jan 29, 2018 in Jira

What are common themes you've seen across successful & failed Jira Software implementations?

Hey everyone! My name is Sarah Schuster, and I'm a Customer Success Manager in Atlassian specializing in Jira Software Cloud. Over the next few weeks I will be posting discussion topics (8 total) to ...

2,982 views 12 18
Join discussion

Atlassian User Groups

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

Find a group

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

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot