You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
Next: Root
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
Hi,
in behavior, I need to set required field but some times I have values in my list field but other time I have empty list. Depending of project context.
Is it possible to script something to check if my list field is not empty ?
Thanks
Yeah, get the list of options from OptionsManger
Something like this:
import com.atlassian.jira.component.ComponentAccessor
def customFieldManager = ComponentAccessor.customFieldManager
def optionsManager = ComponentAccessor.optionsManager
def cf = customFieldManager.getCustomFieldObjectByName("you list field")
def formField = getFieldById(cf.hiddenFieldId)
def config= cf.getRelevantConfig(issueContext)
def optionList = optionsManager.getOptions(config)
formField.setRequired(optionList.size() > 0)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.