SQL Query to get all field ids of a specific project

Hi guys, I've already asked the question directly to Atlassian support but they suggested that I tried Answers instead.

To setup SSRS reports, we would need to obtain all the field IDs that are used in his project. I was wondering if there was an SQL query that I could execute to obtain all the IDs of the fields used in a specific project or into specific Screen Schemes ?

Thank you

Sebastien

2 answers

1 accepted

This widget could not be displayed.
Richie Gee Atlassian Team Feb 18, 2014

For screen and field configuration, you can tweak the below code to obtain the result you wanted:

select * from fieldscreenlayoutitem where fieldscreentab in (select ID from fieldscreentab where fieldscreen = (select ID from fieldscreen where name like '%Default%'));

The above will list the field association with the field configuration default that came with JIRA, for you, you might need to tweak the keyword default to another keyword that suits your need.

There is no direct tie between fields (other than system fields) with the project other than you restrict to specific project.

Hope this helps

Thank you Richie, that answers my question.

Hi All,

any query to get all  " Select List (single choice)"  fields for a particular project

and corresponding values .

 

Thanks

karunakar

This widget could not be displayed.

In general, JIRA's data model is quite denormalised, so this is hard to come with simple table. 

This is what could be done for JIRA 6.4

Step 1

// Get list of IssueTypeScreenSchema for Projects
select sink_node_id, pname from nodeassociation na join project pr on pr.id=na.source_node_id where na.association_type = 'ProjectScheme' and na.sink_node_entity = 'IssueTypeScreenScheme';
 sink_node_id |         pname
--------------+-----------------------
        10100 | PRG
        10300 | Agile-Project

Pick one sink_node_id: eg 10300.


Step 2 

// Get list of all uniq screen elements for IssueTypeScreenSchema

select distinct(fieldidentifier) from fieldscreenlayoutitem join fieldscreentab on fieldscreentab.id=fieldscreenlayoutitem.fieldscreentab join fieldscreen on fieldscreen.id = fieldscreentab.fieldscreen join fieldscreenschemeitem on fieldscreenschemeitem.fieldscreen=fieldscreen.id where fieldscreenscheme in (select fieldscreenscheme from issuetypescreenschemeentity where scheme = 10300)) order by fieldidentifier;
  fieldidentifier
-------------------
 assignee
 attachment
 components
 customfield_10400
 customfield_10401
 customfield_10403
 customfield_10405
 customfield_10408
 description
 environment
 fixVersions
 issuelinks
 issuetype
 labels
...

Note: customfield_10403, this is CustomField with ID 10403

Step 3 - List CustomFields

select id,cfname from customfield;
  id   |        cfname
-------+-----------------------
 10401 | Epic Link
 10403 | Epic Name
 10600 | number-test
 10700 | issueFunction
 10800 | test-user-field

 

Hope this helps. 

 

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted Tuesday in Jira

What modern development practices are at the heart of how your team delivers software?

Hey Community mates! Claire here from the Software Product Marketing team. We all know software development changes rapidly, and it's often tough to keep up. But from our research, we've found the h...

264 views 1 3
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you