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 ?
Yeah, get the list of options from OptionsManger
Something like this:
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)
Jira is a great tool to use across different departments. Forget that paperwork – switch to Jira and get that tasks done smoothly. Marketing Jira allows for a complete digital transformation of you...
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