Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Native Jira Integration: JQL Query Excludes Unresolved Issues When Using wont_fix_resolution #4295

Open
eyeteekay opened this issue Mar 5, 2025 · 1 comment

Comments

@eyeteekay
Copy link

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
@grobinson-grafana
Copy link
Collaborator

Thanks for opening an issue. Do you think you would be able to open a fix for this, including tests, and perhaps a screenshot showing the old (incorrect) behavior and the new (correct) behavior for some test data in Jira?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants