Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

/rest/api/2/issue/createmeta unexpectedly returns issuetype names in Korean

Roger Godfrey September 2, 2018

This is a weird one and I am stuck. 

I am writing an application using C++ and the Qt framework that plugs in to JIRA via the rest API. I am just writing the first part which gets data on projects and issuetypes using /rest/api/2/issue/createmeta. I am testing my code against a cloud hosted JIRA Software instance.

However with my code the response I am getting back from /rest/api/2/issue/createmeta in the JSON has the issuetype names and descriptions in Korean. My instance is setup for English. Also the same transaction in Postman and in Chrome comes back correctly in English.

I am guessing that my HTTP headers are at fault, but I can't see what I am doing wrong. Here is a code fragment that fires off the transaction:

QNetworkRequest request;

m_restURL.clear();
m_restURL.setUrl(mp_jiraInstanceUrl + QString("/rest/api/2/issue/createmeta"));

request.setUrl(m_restURL);

// HTTP Basic authentication header value: base64(username:password)
QString concatenated = *mp_accountName + ":" + mp_password;
QByteArray data = concatenated.toLocal8Bit().toBase64();
QString headerData = "Basic " + data;
request.setRawHeader("Authorization", headerData.toLocal8Bit());

// Other header stuff
request.setRawHeader("X-Atlassian-Token", "nocheck");
request.setRawHeader("Content-Type", "application/json");

mp_reply = qnam.get(request);  // where qnam is previously setup as QNetworkAccessManager qnam;

Any help gratefully received as I am stumped. :)

Edit: Corrected a minor typo.

1 answer

1 accepted

0 votes
Answer accepted
Roger Godfrey September 3, 2018

I have found a work around but I am not sure this is the 'most correct' way of doing this.

I added the following line to the code in the "Other Header Stuff" section:

request.setRawHeader("accept-language", "en-GB,en-US;q=0.9,en;q=0.8,ko;q=0.7");

This seems to tell JIRA that I want responses in English and I am getting correct JSON back. However I am not still sure why my JIRA with its default language set to English would send responses in another language. Weird.

Suggest an answer

Log in or Sign up to answer