Add backend support for open/closed/all states
We want to support the standard GitLab UI showing Open, Closed, and All Jira issues.
In order to do this, we need to be able to query for only opened or only closed issues.
Initially we thought the attribute resolutiondate
would be able to tell us whether an issue was closed or not. However it looks like issues can be resolved
but still be open.
Issues can have a configurable status, such as Open
, Done
, In Review
, Approved
, etc. See https://confluence.atlassian.com/adminjiracloud/issue-statuses-priorities-and-resolutions-973500867.html
But it seems that these various statuses map/group down into 3 specific status "categories": To Do
, In Progress
, and Done
choose a category that this status will be grouped into: 'To Do' (blue), 'In Progress' (yellow) or 'Done' (green). Categories help you identify where issues are in their lifecycle, particularly in places where a large number of issues are rolled up, e.g. Version Details page, Sprint Health Gadget. The category is also used to map statuses to columns in JIRA Software , when creating a new board for an existing project.
Here is an example of the status attribute from a query:
"status": {
"self": "https://gitlab-jira.atlassian.net/rest/api/3/status/6",
"description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.",
"iconUrl": "https://gitlab-jira.atlassian.net/images/icons/statuses/closed.png",
"name": "Closed",
"id": "6",
"statusCategory": {
"self": "https://gitlab-jira.atlassian.net/rest/api/3/statuscategory/3",
"id": 3,
"key": "done",
"colorName": "green",
"name": "Done"
}
},
Based on this, we think that can query for only closed issues using something like project = DEMO AND statusCategory = Done
. Open issues can be queried using project = DEMO AND statusCategory != Done
.
We'll need to put some logic in IssuesFinder or JqlBuilderService
There is still the matter of getting a data that corresponds to when the issue was closed, which needs to get mapped in IssueEntity. We currently use the resolutiondate
, but it doesn't seem like we can rely on that.
In Jira Cloud, there is an attribute called statuscategorychangedate
. So it that's set and the statusCategory == Done
then that should be the closing date.
Unfortunately, it does not seem that Jira Server supports/returns this field.
In a nutshell, we think that:
- all open issues can be queried using a query like
project = DEMO AND statusCategory != Done
- all closed issues can be queried using a query like
project = DEMO AND statusCategory = Done
- for Jira Cloud,
closed_at
can be mapped to thestatuscategorychangedate
if thestatusCategory == Done
- for Jira Server,
closeed_at
will always benil
since there is nostatuscategorychangedate
and theresolutiondate
is not a proper indication of the issue being closed.
This page may contain information related to upcoming products, features and functionality. It is important to note that the information presented is for informational purposes only, so please do not rely on the information for purchasing or planning purposes. Just like with all projects, the items mentioned on the page are subject to change or delay, and the development, release, and timing of any products, features, or functionality remain at the sole discretion of GitLab Inc.