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
Sorry for the late response. I'm not sure if you already found the resolution but here are my two cents on this.
It seems that, this is likely due to payload truncation. Jira has internal response size limits (possibly ~200k), and expand=changelog
can be the root cause for inflating payload size quickly. Also the fields=comment could cause similar problems as there may be some issues which have too many comments, worklogs, or changelog entries which can be the prime suspects in both the problems you're seeing. You can narrow your fields or find those issues and exclude them from your search list. Or you can fetch changelogs or comments separately, per issue, and only for issues you know need them.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.