Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Deleted user
0 / 0 points
Next:
badges earned

Your Points Tracker
Challenges
Leaderboard
  • Global
  • Feed

Badge for your thoughts?

You're enrolled in our new beta rewards program. Join our group to get the inside scoop and share your feedback.

Join group
Recognition
Give the gift of kudos
You have 0 kudos available to give
Who do you want to recognize?
Why do you want to recognize them?
Kudos
Great job appreciating your peers!
Check back soon to give more kudos.

Past Kudos Given
No kudos given
You haven't given any kudos yet. Share the love above and you'll see it here.

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

Hide/enable Checkbox based on Yes or No upon a custom field value selection

Hello all,

I have a requirement of enabling/making visible a checkbox field after a custom field value is selected  from another field.

Once the Check box is visible  with "Yes" and "No" as options.  The user selects Yes then No checkbox should be hidden if he wants to switch unchecking the yes should bring back both for selection.

Need some help in Scripting the behavior so that the checkbox is visible after the custom field selection.

I have the code example found in the forum for the selection of yes or no but couldn't bring back the No after it gets hidden.

 

import com.onresolve.jira.groovy.user.FieldBehaviours
import com.onresolve.jira.groovy.user.FormField
import com.atlassian.jira.component.ComponentAccessor
def customField = getFieldById(fieldChanged)

def cf = ComponentAccessor.getCustomFieldManager().getCustomFieldObject(fieldChanged)
def optionsManager = ComponentAccessor.getOptionsManager()

//Get list of options tied to the custom field
def options = optionsManager.getOptions(cf.getRelevantConfig(issueContext))

//Filter option list with the condition specified
def optionsMap = options.findAll {

//set your conditions, to filter the option list
it.value == "Yes"

}

//Set the filtered optionsMap to the custom field
customField.setFieldOptions(optionsMap)

 

appreciate your help.

 

 

1 answer

Field design as below

image.png

Suggest an answer

Log in or Sign up to answer
TAGS

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