Hi everyone,
I need to count the total number of issues that have a specific property not empty via API REST (cloud).
So when searching for the issues with my specific property, for example:
rest/api/2/search?jql=project=10001&fields=*none&maxResults=-1&properties=com.a.b.c.PANEL_DATA-12345
I get the list of all issues (even the ones that have empty object in this property:
{
"expand": "schema,names",
"startAt": 0,
"maxResults": 100,
"total": 2,
"issues": [
{
"expand": "operations,versionedRepresentations,editmeta,changelog,renderedFields",
"id": "10004",
"self": "https://jira-cloud-abc.atlassian.net/rest/api/3/issue/10004",
"key": "DI-4",
"properties": {
"com.a.b.c.PANEL_DATA-12345": {
"pluginVersion": "1.1-SNAPSHOT",
"platform": "cloud",
"zippedContent": "UEsDBAoAAAAIAO2ERE6g..."
}
}
},
{
"expand": "operations,versionedRepresentations,editmeta,changelog,renderedFields",
"id": "10002",
"self": "https://jira-cloud-abc.atlassian.net/rest/api/3/issue/10002",
"key": "DI-2",
"properties": {}
}
]
}
(as you can see the second issue appears in the results with empty properties and this affects the total number of issues which is set to 2.
Is there a way to simply have in the response only the issues that actually have something in the structure of the property that I am searching (on order to have the real total calculated to 1)? Or I will need to parse all the issues from the response manually in order to count the real total number of the issues?
Thank you