Skip to content

Instantly share code, notes, and snippets.

@vikrantyadav11
Created November 22, 2023 10:34
Show Gist options
  • Save vikrantyadav11/53d9830f16ff89b29087184dc313324a to your computer and use it in GitHub Desktop.
Save vikrantyadav11/53d9830f16ff89b29087184dc313324a to your computer and use it in GitHub Desktop.
import com.adaptavist.hapi.jira.issues.Issues
import com.onresolve.jira.groovy.user.FieldBehaviours
import groovy.transform.BaseScript
@BaseScript FieldBehaviours behaviours
def linkedIssues = getFieldById('issuelinks-issues')
def linkedIssuesValue = linkedIssues.value as List<String>
linkedIssues.clearError()
linkedIssuesValue.each {
def issue = Issues.getByKey(it)
if (issue.issueType.name != 'Story') {
linkedIssues.error = 'Only Story Types Are Allowed'
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment