Missed Team ’24? Catch up on announcements here.

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

How to hide cascading field option in IT View

Salwadi Edukondal April 25, 2024

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("Category and Sub-Category")
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.

2 answers

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.
April 25, 2024

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?

Salwadi Edukondal April 26, 2024

i want to hide option and iam using Jira Servercategory and subcategory.jpg

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.
April 26, 2024

Ok, but why don't you just remove the options you don't want from the second half of the field's list?

Salwadi Edukondal April 29, 2024

@Nic Brough -Adaptavist-  i want it to hide only on IT view it should visible on Portal

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.
April 29, 2024

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.

Salwadi Edukondal May 2, 2024

@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?

0 votes
Joseph Chung Yin
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
April 25, 2024

@Salwadi Edukondal 

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.

Salwadi Edukondal April 26, 2024

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 category and subcategory.jpg

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
TAGS
AUG Leaders

Atlassian Community Events