I am using the below script in custom validator on the create transition, to check if the linked issue on the create screen is a part of a specific project (ABC). Link type I am using is blocks.
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.link.IssueLink
import com.atlassian.jira.issue.MutableIssue
def issueLinkManager = ComponentAccessor.getIssueLinkManager() issueLinkManager.getOutwardLinks(issue.id).any{it.getDestinationObject().getProjectObject().getKey() == 'ABC'}
Expected result should be: It should allow user to create issues if the issue selected in Linked issue field is from ABC project. If not it should throw an error.
Any help would be appreciated.