how to get the option count for a select list in jira 4.4.5

how to get the option count for a select list in jira 4.4.5

6 answers

1 accepted

0 votes
Accepted answer
Janet Albion Atlassian Team Dec 18, 2012

Hi srinath,

I don't really understand the requirement. Just guessing the requirement here.

the following might help you in a way:

1. identify the custom field id:

select * from customfield where customfieldtypekey='com.atlassian.jira.plugin.system.customfieldtypes:select';

2. check how many option in the customfield has and what is the option id:

select * from customfieldoption where customfield=<customfield_id>;

3. find how many time the option is selected

select  count(*) from customfieldvalue where customfield=<customfield_id> and stringvalue=<option_id>;

4. list down all the value and it's corresponding issues that has the value selected:

select * from customfieldvalue where customfield=<customfield_id>;

Generally, 3 main table is related:

* customfield, customfieldoption and customfieldvalue table

Good luck



Thanks all,

My requirment is when configuring the default value for my custom field ,my custom field must select one of the statuses as default value.It worked fine in jira 4.1.2. But when I tried the same in 4.4.5. it is unable to set the default value eventhough my select list is populated with the statuses.

So I am trying to modify the code and Iam first populating the options and from the options I am trying to get the default value.

Is there any alternative way ,so that I can populate the Default value from the select list which contains all the statuses.

Thanks in advance.

What exactly are you trying to do?

I want to add all the statuses to options programatically. For that i am using getAllStatuses().And also only I want the statuses to be act as options and user cannot be able to add the option directly unless it is added as status. For that I want to compare the number of options and no of statuses every time if they are diffrent then I need to erase all the options I want to populate my statuses.

If there is any alternate way please suggest me.

Thanks in advance.

0 votes

I'm sorry, that doesn't make a lot of sense. The best I can make out is that you want to "take a copy of a list of status and put it into a select list, using the status names as the option names?" After that, I'm lost. I'm also curious as to the business reason for doing this (I can think of one, but it's not a lot of use, and the best answer is actually "talk to the users")

Could you explain what you want the user to see and do?

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Nov 27, 2018 in Portfolio for Jira

Introducing a new planning experience in Portfolio for Jira (Server/DC)

In the past, Portfolio for Jira required a high degree of detail–foresight that was unrealistic for many businesses to   have–in   order to produce a reliable long-term roadmap. We're tur...

2,959 views 19 22
Read article

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