Created
May 31, 2023 08:57
-
-
Save vikrantyadav11/a6c514a45340116e38fc2d623676eae5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import com.onresolve.jira.groovy.user.FieldBehaviours | |
import groovy.transform.BaseScript | |
import com.atlassian.jira.component.ComponentAccessor | |
import com.atlassian.jira.issue.Issue | |
import com.atlassian.jira.issue.IssueManager | |
@BaseScript FieldBehaviours behaviours | |
def epicLink = getFieldById(fieldChanged) | |
def epicLinkValue = epicLink.value as String | |
def issue = underlyingIssue | |
def issueManager = ComponentAccessor.getIssueManager() as IssueManager | |
def createdIssue = issueManager.getIssueObject(issue.id) | |
def issueStatus = createdIssue.getStatus().getName() == "To Do" || createdIssue.getStatus().getName() == "In Progress" | |
if (createdIssue != null && issueStatus) { | |
epicLink.clearError() | |
if (epicLinkValue) { | |
if (epicLinkValue.split(':').last() == 'VTPC-20') { | |
epicLink.setError('Invalid') | |
} | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment