It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage
Highlighted

In Select List(Single Choice) customfield selecting an Option text field should pop-up. Edited

Hi Team,

I have field called "Source" select list (single choice) type custom field

in that i have added options A,B,C,D&Other.

Now when i select the option D and Other . A text field has to view on create and edit screen when i select the A,B,C that text field suppose to hide

Select List(Single Choice) custom-field ID-10012

Text Field Custom-field Id-10026

could you explain me  guys step by step  how can I achieve this .

 

Thanks,

Phani

1 comment

Hi All ,

 

I have Resolved this issue my self by using script runner plugin  Behavior  

here is the thing what to do admin settings----->Add-ons--->Behaviors---->Add a Behavior give an name----->Click On Fields--> in that select workflow of project in "Guide workflow" option------>In a fields tab "Add Field"  Select List custom field------>after that click on "Add server-side script".   here is the script that you have to use 

def otherFaveField = getFieldByName("Name Of TextField") //Give a text field custom field name that you have created 
def faveFruitField = getFieldById(getFieldChanged())

def selectedOption = faveFruitField.getValue() as String
def isOtherSelected = (selectedOption == "Other" || selectedOption == "D") //instead of Other/D You can give another option that you want

otherFaveField.setHidden(! isOtherSelected)
otherFaveField.setRequired(isOtherSelected)

 

and then Save it ---->go back to Behaviors--->you will see "Add Mapping" on the side of "Fields" ------>click it and map to "Choose projects(required)" and "Choose issue type" click on Add Mapping

thats it its all got to go

 

when creating/Editing an ticket in the project while creating when you choosing the Select List custom field selecting the "Other"  option it will automatically display the Text Field that you have created and if select another option it wont display the text field

 

Thanks,

Phani

Hi All,

Here is another script this one when you edit the ticket and change the option the text field gonna be empty and disappear

example: the above script when you select the option "D" or "Other" a text field should be appear will enter the text and we created ticket 

after creating ticket if you want to edit the selected list filed with another options like "A or B or C" the above  script still shows the text field that you have entered while you selected option "D" or "Other".

So now with this new script when you edit the selected list filed with options like "A or B or C" the text field also disappears 

 

//customfield_12003 - Data Change Exception
//customfield_12004 - Other Description
if(getFieldById("customfield_12003").getValue().equals("D")
|| getFieldById("customfield_12003").getValue().equals("Other")){
getFieldById("customfield_12004").setHidden(false)
getFieldById("customfield_12004").setRequired(true)
}else{
getFieldById("customfield_12004").setFormValue(null)
getFieldById("customfield_12004").setRequired(false)
getFieldById("customfield_12004").setHidden(true)

} 


 I hope it helps sombody

 

Thanks,

Phani

Comment

Log in or Sign up to comment

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you