It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Cascading Select custom field

I need to add specific custom field with multiply select list, the closest custom field I found is "Cascading Select".

Cascading Select type field with name "Languages":

Parent select liest-> Values
EN -> value1, value2, value3, etc.
DE -> value1, value2, value3, etc.
FR -> value1, value2, value3, etc.
< OTHER> -> value1, value2, value3, etc.

The problem is that user who works on issue can not write his own custom value in parent select list <OTHER>
How can I realize this function? Is there any other suitable custom field for this?

Best regards,

2 answers

1 accepted

2 votes
Answer accepted

User cant enter his own value in a cascade select or select list .. You can provide anthor customfield type i.e labels type . here user can add a new value if it is not present there

Refer this doc about labels customfield

can we add values to select list by plug-in code?

I mean is there a way to create select list and populate it programatically.

What are you trying to do ? you should create a new question describing your issue in detail.

I did that but people marked by question duplicate and close it :)
anyways, I want to create a select list that can be editted dynamically. For example I want to add values to the select list when a issue is marked as resolved.

here is my problem statement -

"user will request to add new customer to the system. he will enter a jira issue. when admin resolved that issue, a listener plug-in will be invoked and it should populate select list (that will have customer names) with new value."

ok .. then i guess you are in the right direction .. all you need to do is add options to the customfield based on the new customer . I dnt think there is any direct method to that . You can use sql procesor to directly add the option to the select list customfield . refer

Mizan, thank you so much for your answer.

Fortunately I am able to update that field but those doesn't reflect on UI. I have to do following to make it help -

1. make some changes like change name of custom field that will ask for reindexing jira

2. then I have add one more option to that custom field and then my add values is reflected.

Do we have anyway so that programatically we can reindex the jira and that value reflects?

here is my code for reference -

org.ofbiz.core.entity.jdbc.SQLProcessor sqlProcessor = null;
            ResultSet rs = null;
                sqlProcessor = new org.ofbiz.core.entity.jdbc.SQLProcessor("defaultDS");
                sqlProcessor.prepareStatement("insert into customfieldoption (Id,CUSTOMFIELD, CUSTOMFIELDCONFIG, PARENTOPTIONID, sequence, customvalue, optiontype, disabled )  select (select max(id) from customfieldoption)+1 Id ,CUSTOMFIELD,max(CUSTOMFIELDCONFIG)  CUSTOMFIELDCONFIG,max(PARENTOPTIONID) PARENTOPTIONID,max(sequence)+1 sequence, 'adnan11' customvalue,max(optiontype) optiontype,max(disabled) disabled from customfieldoption where CUSTOMFIELD=10011  group by CUSTOMFIELD ");
                int result = sqlProcessor.executeUpdate();
            } catch (Exception ex) {
                try {if (rs!= null) rs.close();} catch (SQLException e) {}
                try {if (sqlProcessor != null) sqlProcessor.close();} catch (GenericDataSourceException e) {}

still changes didn't reflected on UI. I have to and refresh the custom field by clicking options like "sort alphabetically"

Anything else that I can try?

Also there is problem when I add value from jira UI. jira doesnt update the sequence and takes the older value. Even if I update SEQUENCE_VALUE_ITEM table.

You can also have Text Field for users to fill the other option.

Show this text field only when others is choosen in the Cascade select, this you can control with java script.

@Chaithra N... how do you do that? can you point us to where this is documented?

Suggest an answer

Log in or Sign up to answer
This widget could not be displayed.
This widget could not be displayed.
Community showcase
Published Apr 09, 2019 in Portfolio for Jira

Portfolio for Jira 3.0 is here!

The wait is over... Portfolio for Jira Server and Data Center 3.0 is now officially here! Platform releases offer Atlassian an opportunity to shift our strategy, make bold predictions about t...

1,365 views 14 26
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