Details
-
Suggestion
-
Resolution: Unresolved
-
None
-
None
-
1
-
2
-
Description
NOTE: This suggestion is for JIRA Server. Using JIRA Cloud? 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:
- Help with JQL assignee != reporter - Atlassian Answers
- JQL Scripted Function to check if assignee = reporter? - Atlassian Answers
- Is it possible to search for issues where assignee=reporter? - Atlassian Answers
- Assignee not same as reporter - Atlassian Answers
- JQL Query for searching issues that are assigned to the reporter - Atlassian Answers
- JQL: query issues where assignee != project lead; or where assignee != reporter - Atlassian Answers
Attachments
Issue Links
- relates to
-
JRACLOUD-63400 Add JQL function to allow the comparison of user fields to each other
- Gathering Interest