Jira REST API (v2 or v3, Server and Cloud) error messages are localized, based on the locale of the user associated to the request.
For example, getting a non-existent task when authenticated with credentials using a Chinese locale will return an HTTP 400, with in the response an error message ID 为“10002”的值在域 “project”中不存在。 (which Google translates to The value with ID "10002" does not exist in the domain "project).
Is there a way to not have these error messages localized? I found that the v2 platform docs / Get locale mentions in a slightly different context that Jira responds to an accept-language header. So I tried setting the header to en_US, without success.
Is it feasible? Or is it feasible to get Jira to respond with an additional originalErrorMessage response key containing the un-translated English string? Does a bug / feature request exist or can one be filed?
My use case, for context: I'm totally okay to localize UI, of course! But for API error message it feels like a strange choice. I'm working on automating things in Jira using the API and, to correctly handle errors, the HTTP error code sometimes isn't enough, so I have to do things like if (error.message.includes('not found')) {.... Which obviously breaks down if said error message is translated 😕.