JQL EMPTY operators behave inconsistently in issues match REST API and webhook filters for Issue Properties and Epic Labels

XMLWordPrintable

    • Minor

      Issue Summary

      When JQL is evaluated via:

      • the Issues match REST API (per‑issue “does this issue match this JQL?” checks), and
      • webhooks that use a JQL filter,

      the family of JQL EMPTY operators behaves inconsistently for:

      • Issue Properties (e.g. issue.property[key].path), and
      • Epic Labels (Epic label custom field).

      In particular, the following logically related JQL forms:

      1. field = EMPTY
      2. field != EMPTY
      3. field IS EMPTY
      4. field IS NOT EMPTY
      5. field IN (EMPTY)
      6. field NOT IN (EMPTY)

      do not return consistent results when evaluated through the issues match REST API / webhook matcher, even on the same pair of issues and same field. Some operators behave as if the field existed, while others correctly treat “field not set” as empty.

      Standard JQL search in the issue navigator behaves as expected; this problem is specific to issue match (match REST API and webhooks).

      Steps to Reproduce

      You can reproduce using either webhooks or the issues match REST API.

      A. Using webhooks
      1. Create two issues:
        1. Issue A: configure an Issue Property (e.g. issue.property[key].path) or set an Epic Label.
        2. Issue B: do not set that Issue Property / Epic Label at all.
      2. Configure a Jira webhook with a JQL filter using any one of the above JQL forms:
        like for issue properties:
      issue.property[key].path != EMPTY

      or, for Epic Labels:

      "Epic Label" != EMPTY
      1. Trigger updates on Issue A and Issue B so that the webhook JQL is evaluated.
      2. Observe which issues generate webhook deliveries.
      B. Using the JQL Match REST API

      Create two issues:

      • Issue A – the Issue Property is set (e.g. issue.property[key].path has a value).
      • Issue B – the same Issue Property is not set at all (property does not exist on the issue).

      Call the issues match REST API with both issue IDs and any one of above JQL forms:

      Request:

      { 
        "issueIds": [ 
          <issueId_with_property>, // A 
          <issueId_without_property> // B 
        ], 
        "jqls": [ 
          "issue.property[key].path != EMPTY", 
        ] 
      }
      

      Expected Results

      For Issue Properties and Epic Labels, when evaluated via the issues match REST API and webhooks JQL filter:

      • If the field is not set at all on an issue, then:
        • field = EMPTY, field IS EMPTY, and field IN (EMPTY) should all match that issue.
        • field != EMPTY, field IS NOT EMPTY, and field NOT IN (EMPTY) should all not match that issue.
      • These six expressions should be grouped into two consistent equivalence classes:
        • Empty: = EMPTYIS EMPTYIN (EMPTY)
        • Not empty: != EMPTYIS NOT EMPTYNOT IN (EMPTY)

      Actual Results

      For Issue Properties and Epic Labels, in the issues match REST API and webhook evaluation:

      • IS EMPTY / IS NOT EMPTY behave correctly.
      • = EMPTY and IN (EMPTY) do not match issues where the field is missing, even though IS EMPTY does.
      • != EMPTY and NOT IN (EMPTY) match all issues, including those where the field is not set at all.
      • String comparisons for Epic Labels are case‑sensitive, leading to missed matches when only the case differs.

      Workaround

      For existence checks in webhooks and match REST API:

      • Prefer:
         field IS NOT EMPTY
        instead of:
        field != EMPTY
        field NOT IN (EMPTY)
      • And prefer:
         field IS EMPTY
        instead of:
        field = EMPTY
        field IN (EMPTY)

            Assignee:
            Unassigned
            Reporter:
            Ankit Mishra
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: