Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
Community Members
Community Events
Community Groups

Behaviors - How to restrict versions to unarchived?

How to restrict versions to only unarchived based on this script?


// Sets versions
import com.atlassian.jira.component.ComponentAccessor
import com.onresolve.jira.groovy.user.FieldBehaviours
import groovy.transform.BaseScript

import static com.atlassian.jira.issue.IssueFieldConstants.AFFECTED_VERSIONS

@BaseScript FieldBehaviours fieldBehaviours

def versionManager = ComponentAccessor.getVersionManager()

def issueTypeField = getFieldById(AFFECTED_VERSIONS)
def fieldOptions = versionManager.getVersions(issueContext.projectObject)
def availableOptions = []

availableOptions.addAll(fieldOptions.findAll {"T24 Transact") })



0 answers

Suggest an answer

Log in or Sign up to answer

Atlassian Community Events