Add JQL function to allow the comparison of user fields to each other

XMLWordPrintable

    • 0
    • 8

      NOTE: This suggestion is for JIRA Cloud. Using JIRA Server? See the corresponding suggestion.

      Problem Definition

      It would be helpful with JQL to be able to search for issues by comparing user fields to other user fields (e.g. where Assignee == Reporter or where Reporter == Requested Participants (on service desk))

      Suggested Solution

      Currently this is not possible to do with JQL, as you cannot compare user fields against other user fields. All user field can be compared with is a text value. As for functions, only CurrentUser() and memberOf() functions can be used for this, neither of which can make these kinds of comparisons.

      Why this is important

      This can be very useful from a JIRA admin point of view in order to be able to find issues that meet certain user criteria. For example, when the assignee is also the reporter, or when one of the user fields matches a user in a custom user field. This kind of comparison should be relatively easy to implement within JQL and in turn could extend the functionality significantly.

      Workaround

      This is something that can be done with Scriptrunner. Only then can you gain access to other JQL functions such as

      issuefunction in expression("project = FOO", "assignee != reporter") 
      

      Examples of users on Atlassian Answers looking for this functionality:

            Assignee:
            Unassigned
            Reporter:
            Andy Heinzer (Inactive)
            Votes:
            30 Vote for this issue
            Watchers:
            15 Start watching this issue

              Created:
              Updated: