Hello,
I'd like to ask your help about a configuration change or guidance regarding error handling in our Jira Data Center environment.
Currently, when we send a REST API request with an invalid JQL query, the response includes detailed error messages like the following:
<<<Request>>>
curl ^"https://a........../rest/api/latest/search?jql=1234'\^%\^20\~\^%\^20\^%\^22\^%\^27\^%\^22\^&fields=summary\^%\^2Cissuetype\^%\^2Ccomment\^%\^2Cparent\^%\^2Cstatus\^&startAt=0\^&maxResults=20\^" ^
-H ^"accept: application/json^" ^
-H ^"accept-language: ko,en;q=0.9,en-US;q=0.8^" ^
-b ^"_ga=GA1.1.609629253.1743983912; hkksnm=58; ntfa=6ecd9b81b3d75acde0b109c6f4327558cf085c8fb53ad069be83d8a63ab04d54; nrnhkd=b21a6634cba0505bbcf039a96c2969bf086a688673932ac1bf2a5f97b5f60160278b1e71b2da8d7f8ae62b0da002a0a7291d0bd60c6398aaab5b5303df64cc22265d5280547b02d85d34c6a195ca3b8924dd7c906bdbdbed578239a14f45074bdf65fa3026b8391aaf90e1979bbf8c3eaa9d557fdde9aa034bf909b784c7ebc9dd004d8c447aaebe1174482a8580724b0d7626da81; nrnhkuio=8786c5600abacb7ff712752e59a4e2d734cfca5bcf24faf148d84e0333f4e208fc684dba249a72e0b78f58c09f0bf5056656c2673cdbbd5b1ccca690d83e4a671517254d91be969808fabeb67d0ff5c687728098626d8ed496d4c7b58637cd499677ffc775740f43dbf5f751755263172f6ab5e9e384ce29f2370014c069626b62a3de7456329ebded3e75567ee852281aff165a0fc55de78e9a673acd0cc5075c146abbab6cf1666038cddabf839171156daf9ea5adf79a1dadbab88b673af45c9ff95221050541eb055b1159e31648db18f3aa9a24e41f020b3bc677527d6f5e251c08090e2818330ba6b4a5f254f765b2bb9709aae83ff967262ff2c346f768fe4457ae32dd91b17209d62c745356e893df8ffff5478a0bc5fe4fa6d929fbc6ceaf86510337a7a4363b6a8bbbb2acd15922684ffee1fe02e980f19e29b6b99f2bd1dcbcca45c599c55eb64d981a170af9cba8c1a88f4aebf0704f99f33557599cb496789e9578627b26cbe683fc50806eed3757c8a2a968eaf9745df0cb54; SCOUTER=x2k8c3esqj2csb; ROUTEID=.node1; crowd.token_key=y8WcZ7mnPlLv2crc-x5NbAAAAAAAAgABY3Jvd2RhZG1pbg; JSESSIONID=A3929F863576F6135EECCF5A2607205D.node1; atlassian.xsrf.token=BMGK-6F21-MTQD-19C7_43edba90581d46bd808984349034bb02ad98fbd2_lin; ajs_user_id=59f026f12372e88b4d22940a1364ced10a8efd59; ajs_anonymous_id=9361c437-0cda-46d7-bf4a-5364cc18b25f; _ga_4PWZCRCGZM=GS1.1.1744184560.13.1.1744184579.0.0.0; _ga_YJWKD5S59E=GS1.1.1744182990.1.1.1744185289.0.0.0^" ^
-H ^"priority: u=1, i^" ^
-H ^"referer: https://..................................................\^" ^
-H ^"sec-ch-ua: ^^"Microsoft Edge^^";v=^^"135^^", ^^"Not-A.Brand^^";v=^^"8^^", ^^"Chromium^^";v=^^"135^^"^" ^
-H ^"sec-ch-ua-mobile: ?1^" ^
-H ^"sec-ch-ua-platform: ^^"Android^^"^" ^
-H ^"sec-fetch-dest: empty^" ^
-H ^"sec-fetch-mode: cors^" ^
-H ^"sec-fetch-site: same-origin^" ^
-H ^"user-agent: Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/135.0.0.0 Mobile Safari/537.36 Edg/135.0.0.0^" ^
-H ^"x-requested-with: XMLHttpRequest^"
<<<Response>>>
{
"errorMessages": [
"Error in the JQL Query: Expecting operator but got ' ~ \"'. The valid operators are '=', '!=', '<', '>', '<=', '>=', '~', '!~', 'IN', 'NOT IN', 'IS' and 'IS NOT'. (line 1, character 5)"
],
"errors": {}
}
For security and usability reasons, we would like to suppress these detailed error messages and instead return a more generic error response (e.g., "Invalid request").
Thank you for your help.