Cascading Select custom field

fjodors
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 8, 2013

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

E.g.:
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,
Fyodor

2 answers

1 accepted

3 votes
Answer accepted
Mizan
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 8, 2013

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

https://confluence.atlassian.com/display/JIRA/Adding+a+Custom+Field

MohammadA April 13, 2014

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.

Mizan
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 14, 2014

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

MohammadA April 14, 2014

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."

Mizan
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 14, 2014

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 https://docs.servicerocket.com/pages/viewpage.action?pageId=35389466

MohammadA April 15, 2014

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;
            try{
                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();
                sqlProcessor.close();
            } catch (Exception ex) {
                try {if (rs!= null) rs.close();} catch (SQLException e) {}
                try {if (sqlProcessor != null) sqlProcessor.close();} catch (GenericDataSourceException e) {}
            }



Mizan
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 17, 2014

Try using commit

MohammadA April 20, 2014

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.

0 votes
Chaithra N
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 8, 2013

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.

Jason Horn January 27, 2014

@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