How to temporarily set the languange when using the REST API

Cyril_Bitterich February 18, 2019

We are using a regular stand alone JIRA server.

A customer has set his own language to something different than English.

If I try to use the REST interface (or more specific the python JIRA library) JIRA expects the names to be in his language not English.

So how can I change the language back to English for only those requests that my script tries to do in his name?

In different words:

Connecting to the web interface: USER LANGUAGE

Connecting to REST-API: ENGLISH

2 answers

1 accepted

0 votes
Answer accepted
Thomas Deiler
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 19, 2019

Dear @Cyril_Bitterich ,

I first thought about changing the users "locale" with a PUT /rest/api/2/user, then perform your action and change it back to the original value. Unfortunately this REST method cannot alter "locale". And I think Atlassian will not enable it in the near future: See this similar issue: JRASERVER-46058. :(

What you can do but is absolutely NOT SUPPORTED and of RISK is to alter that value within the DB. (so I didn't recommend this, did I?)

So long

Thomas

Cyril_Bitterich February 20, 2019

@Thomas DeilerNo access to the DB either. :(

 

So it seems the only way to get certain locale is to change it with the user and this locale sticks?

Thomas Deiler
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 20, 2019

yes

0 votes
Raja Shekher Kammara February 19, 2019

Hi Cyril Bitterich

 

This has already been discussed here. Please take a look.

https://community.atlassian.com/t5/Jira-questions/How-can-i-change-language-in-jira-from-Jira-API-in-Java/qaq-p/454306

 

Hope this helps!

 

Warm Regards,

Raja

Cyril_Bitterich February 19, 2019

Sorry, but that does not help me at all.

First: I don't write a plugin but an external script.

Second I am using the REST API and not internal Java classes in the server.

So if you can point me to a place in the REST API where I can access and set a locale for the communication it would be helpful. But for now I get my answers in the users locale. Which differs even from the system default locale.

Suggest an answer

Log in or Sign up to answer