Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

How to create Cascade multiple Select List custom field ?

soni June 30, 2013

I am new to custom field plugin development and need to create a field as cascade select list field as like default provided in JIRA but differently and it will appear in screen as below:

FIELD NAME: <drop downlist 1> <drop downlist 2> <drop downlist 1> <drop downlist 2> <drop downlist 1> <drop downlist 2>

there is no parent child relation ship between dropdown list 1 and dropdown list 2 and it just repeting in three pair as above.

Any one can please suggest me,

1. which type of custom field type i should choose to create this plugin ?

2. In admin configuraiton mode, how would i able to configure two dropdown list ?

3. some apporoch or example stuff which can help me to achieve this , its really appreciate ?

Thank You

4 answers

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

1 vote
Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
June 30, 2013

If there is no relationship between dropdown-1 and dropdown-2, then you do NOT want a cascading select list (the whole point of a cascading select is that there IS a relationship)

You just need two separate select lists, with the same list of options.

soni June 30, 2013

here, list 1 and list 2 have different values and also, how to keep in a line like - <list 1><list2> <list1><list2> <list1><list2> ? it will appear as a header row.

basically, i need it as below:

<month list><Year list> <month list><Year list> <month list><Year list>

0 votes
Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
June 30, 2013

Yes, that's the right class to extend, I think.

I'm not sure I understand your last paragraph though. Are you saying this custom field might have multiple selections? For example, the user will see one field, but need to put in something like <jan 2012> <feb 2014> <jan 2014> ?

That's going to be a bit more complex. You'll need to think quite carefully about storage and how you get the information in and out, and I don't believe there's a useful model currently in the Jira system. You could well be a lot better off looking at using "active objects" instead of a simple custom field. Multiple select lists are closest, but you don't really want a fixed multi-select list. I think what I said about templates is roughly correct - on "view", you'd want the users to see the month/year strings, but for edit/create, you probably need a display area, plus an area that says "add new date" with the list of months and years, and some way to click "add this selection", and you'll need to think about deletion and editing of existing ones. Obviously, a date search is now useless, and you'll need to write a full searcher if you want people to search on this data.

This is not a small simple requirement you have here...

soni June 30, 2013

Yes, values will be like this only :

<jan 2012> <feb 2014> <jan 2014> so, have to preserve all 3 month values and 3 year values.

0 votes
Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
June 30, 2013

Right, so it's nothing like a cascading select.

Start at https://developer.atlassian.com/display/JIRADEV/Custom+Field+Plugin+Module

Basically, though, you'll need some templates to display/edit the data, and some java to talk to the templates and read/write it.

I'd be strongly tempted to code the templates to have a hard coded list of 12 months, and maybe use a select-list type module so that your administrators can maintain the drop-down list of years (the templates define what goes to and from the browser, so your side-by-side requirement is a doddle in there)

The Java will then need to store and retreive your data. You'll need to think about the best storage format - I'd be tempted to use a date/time store (as you can then use a simple date searcher rather than have to write your own date search) but that might not be right for you and plain text might be better.

soni June 30, 2013

Thanks for your comments.

I could not find SelectCFType type which can be extended.

Would it be corret if i would choose - "AbstractCustomFieldType<Map<String, Option>, Option>"

if i suppose to go with this - "AbstractSingleFieldType<Option>" then i am afraid it may not get fail with multiple list as field will have list three times same list (year can have different selection in all three):

<month list (hard coded as suggested> <year list> | <month list (hard coded as suggested> <year list> | <month list (hard coded as suggested> <year list> ?

0 votes
soni June 30, 2013

Still looking into this.. Let me know if any comment..

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

TAGS
AUG Leaders

Atlassian Community Events