Use subquery as parameter for function

Tiago Thomas Assis December 6, 2019

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
Ignacio Pulgar
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.
December 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.

Tiago Thomas Assis December 10, 2019

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

Like Ignacio Pulgar likes this
0 votes
Answer accepted
Jack Brickey
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, 2019

You can leverage the “filter” JQL function.

example

company filter - project = 123 and company = acme

then...

filter = company and parentepic = aaa

Tiago Thomas Assis December 10, 2019

I'll try it! Thanks!

Suggest an answer

Log in or Sign up to answer