Description
JQL Query Excludes Unresolved Issues When Using wont_fix_resolution
Description
When defining a wont_fix_resolution, the JQL query used in Alertmanager 0.28 (as seen in the debug output) is:
jql="resolution != \"Won't Do\" and (resolutiondate is EMPTY OR resolutiondate >= -1440m) and project=\"TEST\" and labels=\"ALERT{........}\" order by status ASC,resolutiondate DESC"
However, this query does not return issues that have no resolution set. This is due to the behavior of JIRA's != operator, which excludes issues where the resolution field is empty (i.e., unresolved).
Reference
See JIRA documentation for details on this behavior: https://confluence.atlassian.com/jirakb/using-not-equals-on-a-resolution-does-not-return-unresolved-issues-635897091.html
Expected Behavior
The query should return both unresolved issues and issues with resolutions that do not match "Won't Do".
Possible Fix
To correctly include unresolved issues, the JQL should be modified to explicitly account for them, such as:
jql="(resolution is EMPTY OR resolution != \"Won't Do\") and (resolutiondate is EMPTY OR resolutiondate >= -1440m) and project=\"TEST\" and labels=\"ALERT{........}\" order by status ASC,resolutiondate DESC"
Steps to Reproduce
- Define a wont_fix_resolution with a JQL query similar to the one above.
- Ensure there are unresolved issues in the project.
- Run the query and observe that unresolved issues are missing from the results.
Environment
- Alertmanager version: 0.28