Question

I have a set of Epics that of which some do and some do not have a value for 'Epic Name'. The field is a required field, but it was not when these issues were created. I want to query all Epics for which Epic Name is not filled out.

What I have tried so far:

  1. These queries

    • type=Epic AND "Epic Name" = ""
    • type=Epic AND "Epic Name" = empty
    • type=Epic AND "Epic Name" is empty
    • type=Epic AND "Epic Name" = " "
  2. Unlocked the 'Epic Name' field in the database

Digging around in the database leads me to believe that these issues to not have an associated custom field 'Epic Name' at all, so it doesn't have a value of Null - it just doesn't exist.

How could I find my Epics that do not have an Epic Name associated?

Was it helpful?

Solution

The following query will show you all Epic-type issues in the database, along with their summaries and the associated epic name (if any):

SELECT p.pkey || '-' || ji.issuenum AS issueid, ji.summary AS issuesummary,
cfv.stringvalue AS epicname
FROM jiraissue ji
LEFT JOIN project p ON p.id=ji.project
LEFT JOIN customfieldvalue cfv ON cfv.customfield=(SELECT id FROM customfield
    WHERE cfname LIKE 'Epic Name') AND cfv.issue=ji.id
WHERE ji.issuetype=(SELECT id FROM issuetype WHERE pname LIKE 'Epic')
ORDER BY p.pkey, ji.issuenum;

If you're using JIRA 6.0 or earlier, you'll have to replace the first "p.pkey || ... as issueid" with "ji.pkey as issueid" and adjust the ORDER BY to match. If using JIRA 6.1+ but using MySQL, the first argument should instead become "concat(p.pkey,'-',ji.issuenum)".

I don't have any no-name epics in my system, so I have no way to test a query that returns only the nameless epics (as opposed to all of them)...but adding this to the WHERE clause should do it:

AND (CFV.stringvalue like '' OR CFV.stringvalue is null)

OTHER TIPS

Works for me:

project = "some name" AND type = Epic and "Epic Name" is empty
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top