It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Use subquery as parameter for function

Hi! I'm trying something with two filters, I need to get all issues that have a certain value in one field, but calling this inside a parentEpic() to pass them as a parameter.

The filter A gets all issues that have the field "Company" filled with the name of a certain company, in my scenario, they'll get only the epics.

The filter B is using the parentEpic for every issue that the Filter A has returned, like a subquery.

I saw others post about it but I couldn't understand it quite.

I don't know if it's something possible, the objective here is to retrieve those issues (story or subtask) for a report, so I'm open to suggestions.


So long and thanks for all the fish!

2 answers

2 accepted

0 votes
Answer accepted
Jack Community Leader Dec 06, 2019

You can leverage the “filter” JQL function.


company filter - project = 123 and company = acme


filter = company and parentepic = aaa

I'll try it! Thanks!

0 votes
Answer accepted
Ignacio Pulgar Community Leader Dec 10, 2019

Hi Tiago,

Unfortunately, parentEpic function does not support a subquery as a parameter.

Sample queries that could be of help in a workaround solution include:

  1. parentEpic in (EPIC-1, EPIC-2, EPIC-3)
  2. parentEpic in issueHistory()
  3. parentEpic in votedIssues()
  4. parentEpic in watchedIssues()

A several-steps solution would be required in either case.

Assuming you do not currently watch any epics, the easiest workaround would be:

  1. Execute a query like: type = Epic AND Company = IBM
  2. Bulk change the resulting epics so that you start watching them.
  3. Execute this query: type in (Story, Sub-task) AND parentEpic in watchedIssues()

After following these steps, you would get the issues you want.

If you were previously watching any other Epics -and if unwatching them is a valid option for you- then you might consider unwatching them all at once in a similar way, through a bulk change after querying all epics in the Jira instance, if necessary.

You may want to set the Company field of the issues returned by the query of step 3 for the info to be better accessible the next time, or, alternatively, export the results to Excel/csv for capturing the issues that are needed for your report.

Hope it helps.

Thanks, Ignacio, I'll figure another way to do this, but you already gave me some ideas.

Like Ignacio Pulgar likes this

Suggest an answer

Log in or Sign up to answer

Community Events

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

Find an event

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

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you