Skip to content

can not get issue links  #89

@ryzn0518

Description

@ryzn0518

Our jira version is 8.12

As I want to validator script to check status of all linked issues before allowing transition, then try to get the issue links, I tried several ways:


import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.link.IssueLinkManager
import org.apache.log4j.Category
import com.atlassian.jira.issue.link.IssueLink;
import com.opensymphony.workflow.InvalidInputException
def Category log = Category.getInstance("com.onresolve.jira.groovy.LinkedIssues")

log.debug("issue key: " + issue.key)

List linkType = ["Duplicate"]
	  	
IssueLinkManager linkMgr = ComponentAccessor.getIssueLinkManager()


def inwardlinks = linkMgr.getInwardLinks(issue.id)
  	
def outwardlinks = linkMgr.getOutwardLinks(issue.id)
  
def links = linkMgr.getIssueLinks(issue.id)

when tried in the workflow, and selected the Linked Issues and add the issue , but the log told that

inwardlinks = []

outwardlinks = []

links = []

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions