Hello
I’m searching for the cheapest way to order issues on client side when ranking of issues changes. I’ll try to describe better what I have in mind.
There is jira board {BOARD] which has filter [FILTER] assigned. The filter has “order by rank asc” at the end.
There is an app [APP] that I’m creating using atlassian connect. That APP takes the FILTER and downloads all issues’ basic info according to it. The APP also has web hooks for jira:issue_updated, jira:issue_created and jira:issue_deleted events.
Now steps to get to my questions are:
- APP is started.
- APP downloads all issues according to the FILTER using ‘/rest/api/2/search’ POST api.
- Since the filter has “order by rank asc” all issues in the app are in proper order.
- Any user moves an issue on the BOARD so that the rank of the issue is changed.
- APP receives jira:issue_updated event with issue data, that includes info like:
"changelog": {
"id": "10458",
"items": [{
"field": "Rank",
"fieldtype": "custom",
"fieldId": "customfield_10019",
"from": "",
"fromString": "",
"to": "",
"toString": "Ranked higher"
}]
}
- Now the APP knows that specific issue’s rank has changed.
So how to put the issue into a proper place in the list of issues that the APP already has?
I was thinking about an api that could return me an issue that is before or after a given issue, but looks like such issue doesn’t exists.
The only solution that I can think about is to get all the issues in order again (as in step 2). Such operation seems expensive. If there are hundred of issues maybe even very expensive .
Any idea how to solve such problem cheaper/better?