I need to search for several Use cases (UC-3 or UC-4 or UC-6 etc), and see a list of user stories that are associated with that Use Case. (if the Use Case is a label on an Epic, the user stories underneath that epic would be listed). Can this be done via code in the search field?
Community moderators have prevented the ability to post new answers.
Hi @Sam Sa
Not natively when the Use Case is a label on an Epic.
You'd need an app with more advanced JQL functions, such as ScriptRunner. Apps like this allow you to apply a sub-query to the main query - so for example:
issueFunction in issuesInEpics("labels in (UC-3,UC4,UC-6)")^ This is searching for all issues in Epics which have one of these labels attached. The part in bold is the sub-query, it is limiting the results to any issues which are children of Epics, where an Epic has one of those UC labels.
----------------------
There are a few alternatives without an app.
Epic Link:
If a UC has a 1-to-1 relationship with an Epic, I would just use the Epic's issue key to perform the search:
"Epic Link" in (ABC-1, ABC-2)
Linked Issues:
If a UC can be associated with multiple Epics, there is an option using Linked Issues. This is how it would work:
You can then utilise this JQL:
"Epic Link" in linkedIssues("ABC-1") OR "Epic Link" in linkedIssues("ABC-2") OR "Epic Link" in linkedIssues("ABC-3")^ In this instance, ABC-X are all Use Cases - so if there are 5 Epics linked to ABC-1, it would provide all the children of those 5 Epics based on this query.
You can specify a link type also if needed, for example:
"Epic Link" in linkedIssues("ABC-1","relates to")----------------------
Linked Issues can be quite flexible, as you could search for issues linked directly to a Use Case also, for example if a Story is linked to a Use Case and has no parent Epic.
If you'd like any assistance setting up either alternative - or have any further queries - let me know :)
Ste
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.