Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

List ALL statuses using SQL (including custom issue statuses)

Lars Suffys March 23, 2018

Hi guys,

I'm a trainee and i have maybe a stupid question but i need help :)

 

I need an sql query that lists all status names, including the ones not automatically generated by JIRA

I have this:

SELECT issuestatus.pname
FROM jiraissue as j
LEFT JOIN issuestatus ON j.issuestatus = issuestatus.SEQUENCE

This works for statusses built in JIRA but not the ones i created myself like "Waiting for customer". These custom made statusses list as NULL

 

How can i list ALL the statusses?

2 answers

1 accepted

0 votes
Answer accepted
Lars Suffys March 23, 2018

I found the mistake myself, I joined on issuestatus.SEQUENCE = j.issuestatus

it should be: issuestatus.ID = j.issuestatus

0 votes
Nic Brough -Adaptavist-
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

Dump the join, it's pointless.  Issuestatus is the list of status.

Lars Suffys March 23, 2018

My full query is a bit more complicated.

SELECT concat(p.pkey,'-',j.issuenum) as Issuekey,j.SUMMARY as Summary,issuestatus.pname as Status,j.ASSIGNEE
FROM jiraissue as j
LEFT JOIN project as p ON p.id = j.PROJECT
LEFT JOIN cwd_user as u ON u.lower_user_name = j.REPORTER
LEFT JOIN issuestatus ON issuestatus.SEQUENCE =j.issuestatus
WHERE (SUBSTRING_INDEX(SUBSTR(u.lower_email_address, INSTR(u.lower_email_address, '@') + 1),'.',1))
LIKE (SUBSTRING_INDEX(SUBSTR("martin.boehme@communardo.at", INSTR("martin.boehme@communardo.at", '@') + 1),'.',1))

 With this query i want to list information about related issues who have a reporter with the same email domain as "martin.boehme@communardo.at"

This query works but in the Status field it gives NULL on certain issue status (issue statusses that are not automatically generated by JIRA)

Lars Suffys March 23, 2018

I found the mistake, i joined on issuestatus.SEQUENCE = j.issuestatus.

It should be: issuestatus.ID = j.issuestatus

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events