I have a field called category and subcategory which has option "Location". if select location which has two options Hyderabad, Bangalore. i want to hide option Bangalore. have a code below
def abuFF = getFieldByName("")
Object t1=abuFF.value
ArrayList al1 = new ArrayList();
al1 = (ArrayList) t1;
String Cat=al1[0].toString()
String subCat=al1[1].toString()
if (subCat.value == "Bangalore") {
subCat.setHidden(true)
}
else {
subCat.setHidden(false)
}
Please let me know how to hide an option from the field.
Welcome to the Atlassian Community!
That's what a cascading select list does by default (the selection in the first half of the field determines the options available in the second).
So I am unsure what you are trying to achieve here. Could you explain more about what you're trying to do?
Also, you've said this is a question for Cloud Behaviours, but your code looks very Server/DC based - can you confirm which platform you are on?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Ok, but why don't you just remove the options you don't want from the second half of the field's list?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Ah, ok, that makes sense.
I've never tried to amend cascading select lists' second half option list, so I am not sure what to tell you.
But there is some code at https://community.atlassian.com/t5/Jira-Software-questions/Hide-options-in-cascade-select-field-Behaviour-Script-Runner/qaq-p/1142517 which says it does it.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Nic Brough -Adaptavist- thanks that is working. Buts its working for both IT view and Portal view. is there any method to write for only IT View or any other process?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi there:
Are those two fields or just one field (cascade select list date type)? If they are two separate fields, then are you currently using third party add-ons (i.e. ScriptRunner for Jira with Behavior component setup) to control the fields option displays where when the 1st field is populated and its value controls the display of the 2nd field?
Please advise, so we can assist you further.
Best, Joseph Chung Yin
Jira/JSM Functional Lead, Global Technology Applications Team
Viasat Inc.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
there is only 1 cascading field i am using Category and Subcategory field. this field has option Location. If i select Location it will populate another 2 options. i want to hide one option
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.