Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How can I juse a JQL query to find matching field values?

Bailey Hecksel
Contributor
March 22, 2023

I'd like to create a filter that finds issues where X field value is the same as Y field value.

I have two fields, "Reporter" and "Direct Manager" that are tied into a workflow. Both of these fields are user pickers and it's possible for users to set themselves for both the Reporter and Direct Manager fields. The Direct Manager field is what the workflow pulls an approver from. Since the Reporter cannot approve their own ticket, when they select themselves as both the Reporter and Direct Manager it get's stuck until an agent manually updates the Direct Manager field to someone else.

I'd like to setup a filter that shows me all tickets where the field value for Reporter is the same as the field value for Direct Manager.

I've done some searching, but haven't found a good answer. Paid add-ons are not an option.

Hopefully the above makes sense. Any help would be appreciated!

1 answer

1 accepted

3 votes
Answer accepted
Trudy Claspill
Community Champion
March 22, 2023

Hello @Bailey Hecksel 

Without a third party app you can't write a JQL that will directly compare two fields.

You could set up an Automation Rule to find such tickets. There are several different ways you could set up such a rule.

1. You could have a scheduled rule that retrieves all the issues in the specified that have changed since the last time the rule ran. Follow that with an Advanced Compare to compare one field to the smart value of the other field. If they are the same, take some action (i.e. send an email)

2. You could have a custom field that keeps track of whether or not the two fields have the same value. Use an Automation rule to compare the two fields any time either one is changed. If they are the same, set the custom field to True/Yes/1. If they are not the same set the custom field to False/No/0. Then you can use that custom field in a filter.

Bailey Hecksel
Contributor
March 23, 2023

Thanks for the options, Trudy!

Marc Isikoff
Contributor
June 21, 2024

I will refute what Trudy said. You can compare without a 3rd party (e.g., marketplace) app.

We do automations based on comments where we branch based on if the status is with a team or with the customer and have to then see if the last comment made was from the same or the other side then do or do not transition to/from waiting for customer.

{{issue.reporter}} is valid for comparison to any other people picker field such as {{issue.comments.last.author}} and we use the compare two values conditional check. Works flawlessly.

The trick is the know what the field names are expressed as JQL automation (e.g., {{issue.ABCDEF}}

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
TAGS
AUG Leaders

Atlassian Community Events