We need to run a search via JQL that will allow us to find issues where the value of the assignee field is equal to the value of the developer field. Obviously assignee = developer doesn't work; it tries to find any issues where the assignee field is set to the word developer. (Developer is a custom field.)
I found this answer which says that ScriptRunner can do it like this:
issuefunction in expression("project = FOO", "assignee = developer")
But a later question with an answer by the same person indicates that the ScriptRunner function will only work if the custom field is a date, datetime or numeric field.
Will the plugin work on a single user picker field, as indicated in the first post? If not, is there any other way to do this? It's something that SQL can do natively, and seems really unusual that Jira would not allow us to do that kind of search with JQL.
The documentation of the expression function contains a section named conversions which states:
Users
A String containing the user key. This is sufficient as they are just used for equality comparisons
So, I'd say Script Runner supports username equality comparisons.
Call me an idiot, but that sounds like my sample expression above should work. But it gives me an error:
Token ("=" at 1:10: "=" ) is not allowed
1:10 is, I'm guessing, first line, 10th position, which is the equals sign.
I also tried changing it to a double equals, and got this error:
java.lang.IllegalArgumentException: Unhandled custom field: customfield_11200
So I have to assume it's not supported the way you think it is. Note that I'm not trying to create my own JQL functions; I'm just looking to put this directly into a search.
WAIT. "A String containing the user key." Does that mean that I need to search for specific values? Like, issuefunction in expression("project = PH", "assignee == estrom")? That's exactly what I said I'm NOT trying to do. I don't KNOW the user names. What I'm trying to do is find ANY ticket where the person in the assignee field, whoever they are, is also the person in the developer field.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.