-
Suggestion
-
Resolution: Unresolved
-
6
-
0
-
Issue Summary
Currently, Jira returns request type names in the user's locale on both the UI and APIs. However, when constructing JQL, Jira expects the request type name to be in the project's default language. This discrepancy causes issues for users who interact with Jira's API to retrieve issues and then attempt to construct JQL queries using the returned request type names. If a user's locale language differs from the project's default language, the JQL validation fails due to the language mismatch.
Steps to Reproduce
- Create a Custom Request Type in a Jira Service Project.
- Add translations for that Request Type and change the project default language to Spanish (or any other language except English)
- Now use the issue search API or eval API to load the issues in the project. Example for eval:
fetch("https://<host>/rest/api/3/expression/eval", { "headers": { "accept": "application/json", "content-type": "application/json" }, "body": "{\"expression\":\"issues.map(i=>[i.id,i.<customFieldId>&&i.<customFieldId>.requestType&&i.<customFieldId>.requestType.name])\",\"context\":{\"issues\":{\"jql\":{\"query\":\"project is not EMPTY\",\"startAt\":0,\"maxResults\":1000,\"validation\":\"none\"}}}}", "method": "POST", });
Expected Results
When using the Jira API to retrieve issues from a project that has a non-English default language, the request type names should be returned in the project's default language.
These translated names should be usable directly in JQL queries without modification, as JQL will expect them in the project's default language.
To enhance this functionality, it would be ideal if Jira's JQL could accept either Request Type IDs or localised names, allowing querying regardless of user locale or project language settings.
Actual Results
The Jira API returns request type names in English, regardless of the project's default language setting.
As a result, attempting to use these English names in JQL queries fails because JQL expects the names in the project's default language.
Workaround
- For Jira Cloud APIs, to get data returned in a specific language instead of the requester’s default locale, you can use the special header Accept-Language together with X-Force-Accept-Language = true see more in The Jira Cloud platform REST API
- JSM also provide APIs to get request type, for example Get all request types or Get request type by id , for these APIs, you can use a special query parameter requestLanguage to force response to be in your desired language, see more in The Jira Service Management Cloud REST API
You can use our internal API GET /rest/servicedesk/lingo-integration/1/manage-language/{projectId} to get project default language. Note that this is an INTERNAL api and MIGHT CHANGE WITHOUT NOTICE.