Iterative Custom Field (scripting/workaround needed)

T B November 4, 2013

Hi!

As seen in the picture I have a cascading (the values in the second list depend on the value chosen in the first) list. It all works fine, however, I want to be able to add that field ("Criterion Score") multiple times, and the assignee can choose different values for each different instance.

I basically want to be able to add the two cascading combo-boxes multiple times in an user-controlled (e.g. via an add button) iterative manner. As far as I could tell there where no standard custom field type (or composed custom field) that had this iterative functionality. Can anyone that has experience with scripting suggest a workaround?

I think such an iterative element could be useful. Some might describe what I mention as a multiselect cascading list, however, I just want a normal cascading list (with 2 levels) that can be replicated multiple times (actively, by the assingnee, in the view) and not just a multiselect cascading list -- which, in my opinion, doesn't make much sense as cascading lists are not meant to be multiselect.

Any comment or suggestion is appreciated.

Cheers,
T.B.


1 answer

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

2 votes
Answer accepted
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.
November 4, 2013

You're going to need to code for this, and not just a bit of scripting.

Jira does not have any field data structure in it that allows for multi-line fields (except for comments), so you'll need to add that functionality first (I'd use active objects, as you're going to need a new type of data structure), along with a multi-line interface for your field on the front end.

The closest you can get with simple scripting would be to create (say) 20 copies of your field, then use scripting to hide all the empty ones. There wouldn't be any logical relationship between them, so you'd need more scripting to get them to appear in a useful way in searches (yes, I've done this, albeit with single-select lists. Script-runner and behaviour plugins really do help, but it's still not quite what you need)

T B November 5, 2013

Can you give a sample of the simple scripting approach, just to get me started (add N times that button with or without hiding). Also, it does not have to be a multi-line field, it can be more fields replicated, the important thing is to have them there (in N copies) and be able to add them in one swoop or ideally each new one on-demand.

If not I will have to start trying to change JIRA's model, though I am hesitant to do that.

P.S. Thanks for the prompt reply and the good insight.

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.
November 6, 2013

I did it on version 3 of Jira, and since then, I've avoided javascript hacks like the plague (I'm not a good javascript coder, they're not secure, and they almost always break on upgrade...)

All I can really tell you is that a script should hide all but the first of the 20 fields you define and then for each one entered, unhide the next line.

TAGS
AUG Leaders

Atlassian Community Events