Custom Field - Cascading List - Get Parent Field, Count Child Field Issues

Drew G April 21, 2023

Hello - 

I've been trying to find a solution to count the number of Issues that contain ANY child fields within a parent field on a cascading list custom field. 

What I'm trying to achieve, via the basic pie chart gadget on the dashboard, is to build a filter that shows the number of issues that exist within a parent field in a cascading select list.

For example: I have 2 parent fields with some child field options:

- Virginia

    - Richmond, Charlottesville, Culpeper

- North Carolina

    - Raleigh, Chapel Hill, Durham

 

I want the pie chart to show Virginia and North Carolina, and then be able to tell me how many issues exist with ANY of the child selections.

Does that make sense? I've been struggling to articulate this, which has made it more difficult to find a solution.

So far the only JQL I see is the cascadeOption() syntax, and that doesn't seem to be the solution. Any ideas?

1 answer

1 vote
David Martínez López April 21, 2023

To count the number of issues that contain ANY secondary field within a primary field in a cascading select custom field, you can use a JQL query with the "IN" function and the "cascadeOption()" function.

For example, if your cascading select custom field is called "State", and your options are Virginia and North Carolina, and each has secondary options (Richmond, Charlottesville, Culpeper for Virginia, and Raleigh, Chapel Hill, Durham for North Carolina), you can use the following JQL query to count the number of issues that contain ANY secondary field within each state:

State in cascadeOption("Virginia", "Richmond", "Charlottesville", "Culpeper") OR State in cascadeOption("North Carolina", "Raleigh", "Chapel Hill", "Durham")

This JQL query will search for issues that have the value "Virginia", "Richmond", "Charlottesville", or "Culpeper" in the "State" field, OR the value "North Carolina", "Raleigh", "Chapel Hill", or "Durham" in the "State" field.

Once you have created this JQL query, you can use it in the basic pie chart gadget on the dashboard to show the number of issues that exist within each state. To do this, select the pie chart type and choose the "Show filter" option in the gadget settings. Then, enter the JQL query we just created in the filter field and make sure to save the configuration.

Drew G April 21, 2023

Hi David - Really appreciate your help here. I think I am tracking so far. Testing the JQL now. A piece it seems like I am missing - How am I getting the pie chart gadget to COUNT the Issues, rather than just showing me ALL of the child Issues?

Suggest an answer

Log in or Sign up to answer