I'm trying to set up functionality similar to https://jamieechlin.atlassian.net/wiki/display/JBHV/Miscellaneous+Behaviours+Examples#MiscellaneousBehavioursExamples-Addorremoveoptionstosingleormulti-selectfields but instead of a single or multi select field, I'm trying to do so with a cascading select field. The below code will populate the first dropdown of a cascading select field, but none of the values from the second dropdown show up. Does anyone have any information on how the data needs to be formatted in order to get the setFieldOptions method to work for both dropdowns in a cascading select field?
FormField functionalArea = getFieldByName("Functional Area") def ops = ["-1":"None"] ops.put("50632","508 Compliance Testing") ops.put("50620","Activity Tracking") functionalArea.setFieldOptions(ops)
I don't remember if cascading selects are properly supported or not, but your example code is what you'd use for setting a single select. For cascading selects the values should themselves be option ID->value maps.
I was thinking about that too. But doing this seems to not adjust the values seen on the screen at all. No errors in the log either. Then I started thinking again, wouldn't the second value in the map need to be a list of maps in order to handle multiple values in the second dropdown? I implemented the below map to setFormValues() with, and again, it doesn't appear to adjust the values either with no errors in the log. I enabled debugging and it returns a map. def ops = [:] ops.put(["-1":"None"],["-1":"None"]) ops.put(["50632":"508 Compliance Testing"],["-1":"None"]) ops.put(["50620":"Activity Tracking"],[["-1","None"],["50621":"To Do List"],["50628":"Work Activity Log"]]) /rest/com.onresolve.jira.plugin.Behaviours/1.0/behaviours/runvalidator.json [onresolve.jira.groovy.BehaviourManagerImpl] Returning map: [customfield_10081:[fieldOptions:[[-1:None]:[-1:None], [50632:508 Compliance Testing]:[-1:None], [50620:Activity Tracking]:[[-1, None], [50621:To Do List], [50628:Work Activity Log]]], fieldType:com.atlassian.jira.plugin.system.customfieldtypes:cascadingselect, displayName:Functional Area]] Is there any way you could determine if cascading selects are properly supported? I'm starting to get the feeling they aren't based on my inability get it to work with all the different data types I've tried to put in here.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I do not have a functional test for cascading selects, which I'm afraid suggests to me that they are not implemented. There is also https://jamieechlin.atlassian.net/browse/JBHV-202.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Alright. I think I'll just mark this as an accepted answer because functionality not implemented is what it is. I'm sure if you do implement it in the future, you will put it in the release notes for the plugin. Thanks for looking into this and thanks for making a great plugin for JIRA.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
thanks for your understanding.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I haven't found an alternative yet. I told the group that requested it from me that it wasn't possible to my knowledge, and I will investigate any solutions that might implement this functionality.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Looks like this was resolved through https://productsupport.adaptavist.com/browse/SRJIRA-2125
Thanks @Jamie Echlin _ScriptRunner - The Adaptavist Group_!!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Don't think so:
SRJIRA-2125 is about the ability to choose values in the form - setFormValue() i.e. the values have to already be present in the select list in order to be set.
The question is about setting the *list of options* in a cascading select list i.e. using setFieldOptions on a cascading select
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I am still not able to set the child option with setFieldOptions(), is there a solution available yet?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Adam Yerkman, have you found a solution for this?
Thank you in advance
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.