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 { it.name.startsWith("T24 Transact") })
issueTypeField.setFieldOptions(availableOptions)
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.