JQL for searching value of one field equals value of another field

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.

1 answer

0 vote

The documentation of the expression function contains a section named conversions which states:


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. 

Suggest an answer

Log in or Join to answer
Community showcase
Sarah Schuster
Posted Jan 29, 2018 in Jira

What are common themes you've seen across successful & failed Jira Software implementations?

Hey everyone! My name is Sarah Schuster, and I'm a Customer Success Manager in Atlassian specializing in Jira Software Cloud. Over the next few weeks I will be posting discussion topics (8 total) to ...

3,308 views 14 20
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot