Hi! I'm an engineer at Truffle Security. We switched to the enhanced issue search endpoint and that's been mostly successful. We've run into two issues though:
1. The endpoint sometimes returns invalid JSON. The returned data is too large to be logged (> 200k); perhaps that suggests it's just being truncated by Jira? We saw this with `maxResults` both at `100` and `10`, but it seems fixed at `1`.
2. Occasionally we get `500` status responses from Jira. Two examples are:
{
"errorMessages": [
"Caught PSQLException for select /* called at com.atlassian.jira.issue.link.DefaultIssueLinkManager.lambda$executeQueryOutwardLinks$64(DefaultIssueLinkManager.java:1358) */\"ISSUE_LINK\".\"id\", \"ISSUE_LINK\".\"linktype\", \"ISSUE_LINK\".\"source\", \"ISSUE_LINK\".\"destination\", \"ISSUE_LINK\".\"sequence\", \"ISSUE_LINK\".\"created\", \"ISSUE_LINK\".\"updated\"\nfrom \"public\".\"issuelink\" \"ISSUE_LINK\"\nleft join \"public\".\"issuelinktype\" \"ISSUE_LINK_TYPE\"\non \"ISSUE_LINK\".\"linktype\" = \"ISSUE_LINK_TYPE\".\"id\"\njoin \"public\".\"jiraissue\" \"ISSUE\"\non \"ISSUE_LINK\".\"destination\" = \"ISSUE\".\"id\"\njoin \"public\".\"project\" \"PROJECT\"\non \"ISSUE\".\"project\" = \"PROJECT\".\"id\"\nwhere \"ISSUE_LINK\".\"source\" = ? and (\"ISSUE_LINK_TYPE\".\"pstyle\" is null or \"ISSUE_LINK_TYPE\".\"pstyle\" not in (?, ?)) and \"PROJECT\".\"status\" != ?\norder by \"ISSUE_LINK\".\"created\" asc"
]
}
{
"message": "Caught PSQLException for with \"CHANGE_ITEM\" as (select \"CHANGE_ITEM\".\"newvalue\", \"CHANGE_ITEM\".\"oldvalue\"\nfrom \"public\".\"changeitem\" \"CHANGE_ITEM\"\nwhere \"CHANGE_ITEM\".\"groupid\" = ANY (?) and \"CHANGE_ITEM\".\"fieldid\" = ANY(SELECT UNNEST(?)))\nselect /* called at com.atlassian.jira.issue.changehistory.ChangeHistoryUserMapperFactoryImpl.lambda$buildForChangeGroupIds$5(ChangeHistoryUserMapperFactoryImpl.java:185) */\"value\"\nfrom ((select \"CHANGE_ITEM\".\"newvalue\" as \"value\"\nfrom \"CHANGE_ITEM\" \"CHANGE_ITEM\")\nunion\n(select \"CHANGE_ITEM\".\"oldvalue\" as \"value\"\nfrom \"CHANGE_ITEM\" \"CHANGE_ITEM\")) as \"union_alias\"",
"status-code": 500,
"stack-trace": ""
}
Here's an example of the request we make:
curl -v -G https://api.jira.com/rest/api/2/search/jql \
-H 'Accept: application/json' \
-d 'jql=project="blah"' \
-d 'maxResults=1' \
-d 'expand=names,changelog' \
-d 'fields=summary,description,creator,comment,reporter,attachment,created'
We recognize that this endpoint isn't a drop-in replacement for the previous--first deprecated and now removed--endpoint, and we're working to move to bulk requests. Our hunch is we're simply asking too much of this endpoint and causing problems. But if that's true, it felt useful to flag for you all, and if it's not true, then maybe there's something we can do on our end. Thanks in advance!
-Charlie