Is there a way to use a CONTAINS operator with "Epic Link" in JQL?

glen March 23, 2018

I want to get a list of stories that are contained in several different epics, and all the epics start with the same keyword. Is there any way to use a CONTAINS operator with "Epic Link"?

If I type in the advanced search field, after typing "Epic Link", JQL only shows me EQUALS, IS, and IN operators (and the 'not' versions). It doesn't have CONTAINS.

If I use the basic search, I can select the "More" dropdown and select "Epic Link", and then type "foo - " in the dialog that comes up and it will give me a list of all epic links that start with "foo -". I can check the ones I want. The result is the list of stories that I'm interested in. That's great.

If I then switch from basic to advanced, the resulting JQL is:

    issuetype = Story AND "Epic Link" in (PROJECT_NAME-1, PROJECT_NAME-2, PROJECT_NAME-3)

So, in basic mode, it knew how to find all Epic Links that started with "foo -" because it gave me a list. But the end result was an IN operator with the epic links listed out. If another epic link gets created that has "foo -" in the name, I don't want to have to update my JQL with another PROJECT_NAME-XXX. I just want something like:

   issuetype = Story AND "Epic Link" ~ "foo -"

2 answers

2 votes
Nodas Anastasiou November 21, 2019

project =xxxx AND issuetype = Epic AND text ~ "xxxx" ORDER BY priority DESC, updated DESC worked for me :)

0 votes
Randy
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.
March 23, 2018

Not with the standard JQL functionality but you might be able to with the ScriptRunner Scripted JQL feature:

 

https://scriptrunner.adaptavist.com/latest/jira/jql-functions.html

Suggest an answer

Log in or Sign up to answer