database - issue type of a project

Cláudia Silva April 26, 2013

hi,

how can i know the issue types that belong to a project? if i use the table nodeassociation i know the issue type screen of project, but not issue types. where is the table that relates "issuetype" whith "issuetypescreenscheme"?

SELECT

proj.pname AS project,

issc.name AS issuetypescreen

FROM

project proj

JOIN

nodeassociation na

ON

proj.id = na.source_node_id

JOIN

issuetypescreenscheme issc

ON

na.sink_node_id = issc.id

AND sink_node_entity = 'IssueTypeScreenScheme';

thanks,

4 answers

1 accepted

1 vote
Answer accepted
Vidic Florjan
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.
April 26, 2013

Link to Jira SQl examples: Example SQL queries for JIRA

Link to Get Issue Types for project example: https://confluence.atlassian.com/display/JIRACOM/Example+SQL+queries+for+JIRA#ExampleSQLqueriesforJIRA-GetIssueTypesforproject

SELECT IT.id, IT.pname
FROM configurationcontext               CC
LEFT OUTER JOIN optionconfiguration     OC ON OC.fieldconfig = CC.fieldconfigscheme
LEFT OUTER JOIN issuetype               IT ON IT.id = OC.optionid
WHERE CC.project = 10000

10000 is ID of the project

Jeff Louwerse
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.
April 2, 2018

still works today but you might want to add  this to the where clause  

 and CC.customfield = 'issuetype'

0 votes
Ipsita Dash May 9, 2019

Hi,

 

Below query gives me all the projects which have a particular issue type.

Give a try.

 

SELECT DISTINCT P.pname, P.pkey, P.lead AS project
FROM project as P
INNER JOIN jiraissue as J on J.PROJECT = P.ID
INNER JOIN issuetype as I on I.ID = J.issuetype 
WHERE J.issuetype= 10300

 

Thanks,

Ipsita Dash

0 votes
Cláudia Silva May 1, 2013

thank you so much.

but i have been reading the documentation and i read this:

Notes about working with the JIRA database:

(warning) Please Note: Direct database queries are not recommended in JIRA. Instead, we recommend adding or modifying data via JIRA's REST APIs, JIRA RPC Services (deprecated) or Jelly Tags.

But, my my goal is only acess to information, not modify. It is recomended use the res api (for example) for this?

With the rest api can i acess an issue types of a project?

best regards

ana mendes

Gregory Kneller
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.
May 15, 2014

Ana, please do not worry about this note from Atlassian. All API are very poor, and Atlassian changes focus often from one API to another. For example, they drop Jelly and try to imporve REST but it is still not very functional. Use database, to read or to write (but test everyting first in a non-production instance)

0 votes
cofarrell
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.
April 26, 2013

I hope you don't mind but I updated to the tags to be JIRA instead of Stash which is what I assume you meant.

Suggest an answer

Log in or Sign up to answer