which database table holds custom fields information?

 

1 answer

1 accepted

This widget could not be displayed.

Curiously, I am mucking about with this very thing right now. The tables you want will be:

  • customfield - Contains the definition of the fields
  • customfieldoption - Contains any defaults or other information that might be set in the field
  • customfieldvalue - Contains the actual values held by the fields.

IF you are going to modify this outside JIRA, you'll want to stop the instance, do the mods and make sure you set unique id values larger than what is in there and then update the sequence table. This link is of great help for that: https://developer.atlassian.com/jiradev/jira-platform/jira-architecture/database-schema#Databaseschema-Customfields

Good luck

 

Hi Mike,

 

Thanks for the response.

Please find custom fields and  ID's and project ID below.

 

custom field 1: Percent QA Testing Completed

fieldId=customfield_10502

 

custom field 2: Percent UAT Testing Completed

fieldId=customfield_10503

 

Project ID: EditIssueType!default.jspa?id=10104

 

Project Key=DA

I ran below query and result came out no search is found.

 

select * from [jiraschema].[customfieldvalue]

where issue=(select id from [jiraschema].jiraissue

   where project = (SELECT id from [jiraschema].project

   where pkey='10502') AND issuenum = '10503');

 

 

I want those customfield tables in database. please let me know how can i find it out.

 

Thanks,

srikanth 

Please, avoid touching the database, it's a pain to use for reporting/lookups, and there are no circumstances under which it's a good idea to write to it (beyond bug fixes).

But, if you must.

I don't understand what your query is trying to do, it looks very very confused.  You appear to be using custom field IDs to read the issue for a start, which is complete nonsense.

I am going to guess that you want the value of the custom fields named "Parent QA/UAT testing complete", AND that those fields are simple text or numeric fields.

First, read the project table for the project key

select id from project where key = 'DA' ;

Then you can get the values for both custom fields by using

select * from customfieldvalue
join jiraissue on customfield.issue = jiraissue.id
where jiraissue.pkey = <project id from above> and
customfield in ( 10502, 10503 ) ;


I've kept the SQL long winded and probably inefficient, but easier to read and understand how the tables relate.

If the fields are select type fields, you'll need to do more work to get the actual values out.

Suggest an answer

Log in or Sign up to answer
Atlassian Summit 2018

Meet the community IRL

Atlassian Summit is an excellent opportunity for in-person support, training, and networking.

Learn more
Community showcase
Posted Aug 06, 2018 in Jira Service Desk

A is for Activate: Share your top Jira Service Desk onboarding tips for new users!

Hi, everyone! Molly here from the Jira Service Desk Product Marketing Team :).  In the spirit of this month's  august-challenge, we're sourcing stories of Jira Service Desk activation fro...

578 views 25 15
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