Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

How can I create a search query based on an attribute of a jira issue specified

Rahul_Desai January 24, 2020

Say, I have a main JIRA issue which has a particular 'Due Date'. Now I want to create an query based on that JIRA issue key. Say, the query should return JIRA issues which were updated before this due date, but as an input to the query I can give the JIRA issue key. The query should refer to the issue, fetch the 'due Date' from it and the use it. How can this be done. Thanks

2 comments

Comment

Log in or Sign up to comment
Ste Wright
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 25, 2020

Hi @Rahul_Desai

This wouldn't be a simple query - what's the use case in this instance?

You can certainly search using the due date simply - such as:

duedate <= endOfMonth()

or

duedate >= 2019-01-25

To refer to another issue's due date though, I'm not sure on how that would work.

Ste

Muhammad Ramzan(Atlassian Certified Master)
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 25, 2020

@Rahul_Desai  which version you are using cloud or server.

 

It looks like you want the sub query feature which is not possible without third party plugin.

Ste Wright
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 28, 2020

Hi @Rahul_Desai

So you can achieve what you're looking for using a nestled filter, rather than a template issue - here's how to do it:

First, you need to create your due date filter, which will master this data across multiple other filters. So if I want to find all issues which have a due date of 31/01/2020, I will search:

duedate = 2020-01-31

^ Now save this filter - for example as "Due Date Master". When you save a filter, it will be given a Filter ID in the URL - looking something like this: issues/?filter=10452. Save the Filter ID, we'll need this next.

Now I can create three more queries to search for different issue types which match this due date:

issuetype = Story and filter = 10452
issuetype = Bug and filter = 10452
issuetype = Sub-task and filter = 10452

^ Notice that whilst I change the first part, the second part stays the same. This is because JQL is checking if each query meets the parameters of our master filter, i.e the due date.

This means you can change the due date in just one filter, which would update every filter using the "filter =" search parameter.

Feel free to add more to the first filter - and it'll always update any other queries using it as a search parameter.

Ste 

Rahul_Desai January 29, 2020

Thanks @Ste Wright . It solves a part of my use case. I wanted it for every release, so referring  to an jira ticket, which also is a part of that release, was what I wanted.
In your solution I'll have to make different saved filters every release. I wouldn't want to update the filter, as I want to maintain the historical data for future reference.

I'll try to think how I can do it with your approach. Thanks a lot.

Like Ste Wright likes this
Rahul_Desai January 27, 2020

@Ste Wright , the use case in my case is I plan to have 1 JIRA issue, which has schedule information in it, say a date. Now I want my filter to fetch the date from the JIRA issue and use it in other filters. See, I have multiple filters which will be based on one attribute (say due date as in the example). If this due date changes for some reason, I do not want to change it in all my filters. I am looking for a way, where i can make change only in one place, which will be referred to in multiple places... 

Rahul_Desai January 27, 2020

The idea is: I change in one place.. and it reflects in several other filters. Any ideas @Ste Wright 

TAGS
AUG Leaders

Atlassian Community Events