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

Filter for custom fields of Epic and Task

Pauline Hild
Contributor
November 23, 2022

Hello all,
I would like to create a filter that uses custom fields as search criteria both at the level of tasks and epics. However, so far the filter does not work once I add the custom field of the Epic.


The screenshot shows the current syntax.

For example, "Technology: llumina_PCR-free_tagmentation" is a custom field of the task and "Account information: yes" is a custom field of the corresponding epic.

Bildschirm­foto 2022-11-23 um 11.25.23.png

Does anyone know a solution for this problem?


Best regards

Pauline

 

1 answer

1 accepted

0 votes
Answer accepted
Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
November 23, 2022

Hello @Pauline Hild 

When you use the AND operator, every issue in the result set has to satisfy ALL the conditions you specify. So all your issue types must have all these fields and match the criteria.

If some fields are available for only some issue types then you need to use an OR operator. 

Lets say some fields are in both issues types:

Field1 is in Epics and Tasks

Field2 is in only Epics

Field3 is in only Tasks

If you want to find all Tasks and Epics that have Field1=Value1, but also limit the results to Epics where Field2=Value2 and Tasks where Field3=Value3 then your filter would look like this.

Field1=Value1 and ( (issueType=Epic and Field2=Value2) or (issueType=Task and Field3=Value3) )

For more information take a look at

https://support.atlassian.com/jira-software-cloud/docs/what-is-advanced-searching-in-jira-cloud/#Advancedsearching-ConstructingJQLqueries

Pauline Hild
Contributor
November 24, 2022

Hello Trudy,

thanks for your help!

Pauline Hild
Contributor
November 26, 2022

I changed the syntax as you suggested, but always get an error message. I have tried several changes but can't find the error. Do you have any idea?

Bildschirm­foto 2022-11-26 um 15.26.20.png

Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
November 26, 2022

"issue type" needs to be one word with no space - "issuetype"

Pauline Hild
Contributor
November 27, 2022

OK, thanks so far. I changed it, but there still seems to be an error...

Bildschirm­foto 2022-11-27 um 12.19.45.png

Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
November 28, 2022

I recommend that you try smaller pieces of the query to find which piece has the error. 

The pieces related to standard Jira entities (project, issuetype, status) appear to be correct. That suggests to me that there is something wrong with one of the criteria associated with your custom fields:

  • "Go for library"
  • "Technologie[Dropdown]"
  • "Account information[Dropdown]"

The syntax for the dropdown fields appears to also be correct.

Do all of those custom fields exist in the LAB project for the specified issue types?

What type of field is "Go for library"? If you try just that criteria do you get the bad syntax indicator?

project = LAB and "GO for library" is not EMPTY

 You could check each of the other criteria individually to see if they are valid syntax also, and start adding more pieces to figure out which is the problem. For example start with

project = LAB and ((issuetype = Task) or (issuetype = Epic))

Then start adding the other criteria in one at a time until you trigger the bad syntax indicator.

Pauline Hild
Contributor
December 5, 2022

Thank you very much for your detailed answer. I have actually found the solution this way.

But the filter does not yet work as I would like it to. At the moment it shows me the correct tasks, but also all epics where the "Account information" is filled in with "yes".

However, I only want to filter for those tasks where the linked Epic has "yes" as "Account information", i.e. the Epics should not be displayed but only the tasks whose linked Epic has that.


Can I include this in the syntax?

Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
December 5, 2022

Please show us the filter you are using now that is not getting you the results you want.

Pauline Hild
Contributor
December 5, 2022

Sorry, I forgot to attach the screenshot. 

Bildschirm­foto 2022-12-05 um 10.32.44.png

Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
December 5, 2022

Natively Jira allows you to search for Tasks in Epics only if you provide an explicit list of Epic Issue Keys thus:

https://support.atlassian.com/jira-software-cloud/docs/advanced-search-reference-jql-functions/#Advancedsearchingfunctionsreference-parentepicparentEpic--

Project = Lab and parentEpic(<comma separated list of Epic issue keys>) and issuetype = Task and status in (”In Progress”) and “Go for library[Date]” IS NOT EMPTY and “Technologie[Dropdown]” = Illumina_PCR-free_tagmentation

You are trying to create a dynamic list of Epics from which to get Tasks. That is not supported natively in Jira search functionality.

To achieve that you would need a third party app that extends JQL capabilities. There are several available. 

One that I have used is Adaptavist Scriptrunner. If you had that then you could achieve your goal thus:

Project = Lab and issuefunction in issuesInEpics(project=LAB and “Account information[Dropdown]” = yes) and issuetype = Task and status in (”In Progress”) and “Go for library[Date]” IS NOT EMPTY and “Technologie[Dropdown]” = Illumina_PCR-free_tagmentation
Pauline Hild
Contributor
December 6, 2022

I was not aware of that, thanks for the info.

I had thought of another way that I could possibly solve my problem, however I'm not sure if that would work.

I also added the "Account information" field to the task layout and set up an automation rule so that the info entered in this field is transferred from Epic to the task.

Accordingly, I have adjusted the syntax so that "Account information" is now a field of the task.
So far, however, the filter does not work, because no results are found. Is this not possible in principle?

Bildschirm­foto 2022-12-06 um 16.25.31.png

Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
December 6, 2022

In principal this should work. 

Are you sure that the field is getting transferred from the Epic to the Tasks?

Since you have removed the clause that concerned Epics you don't actually need the "((" and "))" anymore. Try removing those and see if the results change.

Try running a search for the original Task criteria (without Account Information) and then visually review the issues to confirm that one of them has the Account Information set to "yes".

Pauline Hild
Contributor
December 7, 2022

I think I have found the problem. The newly created automation takes the information from the "Account information" field from Epic into the task, but only for projects that are now newly created and not for already existing projects. Therefore the "Account information" field is not filled in for the older projects and the filter does not show any results.
To solve this problem, I guess I'll have to resort to the app.

Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
December 7, 2022

You said

I also added the "Account information" field to the task layout and set up an automation rule so that the info entered in this field is transferred from Epic to the task.

You can use a rule to update the older issues also. I don't know what you have for the above rule, but you can create a rule that you trigger manually that will look up all the tasks that have no value in that field and then get it from their parent Epic.

There is a limit to the number of issues a rule can operate against in a single run, so if there are hundreds of issues you may need to run the rule a few times or refine the look up to get a smaller set of issues.

Pauline Hild
Contributor
December 8, 2022

I didn't know there was such a function, that would be very helpful not only in this context. What would the automation rule look like then?


On the screenshot below is my automation that takes the info from the Epic into the task. With newly created projects this already works.

Bildschirm­foto 2022-12-08 um 14.52.01.pngBildschirm­foto 2022-12-08 um 14.52.08.png

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events