Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Closed outward linked issues number

Yevgeniy Klyagin May 28, 2015

Hi all!

I have found the script to get the number of outward linked issues:

import com.atlassian.jira.component.ComponentAccessor
 
def issueLinkManager = ComponentAccessor.getIssueLinkManager()
def issueLinks = issueLinkManager.getOutwardLinks(issue.id)
 
def subElements = issueLinks.findAll {
    it.getIssueLinkType().getName() == "Project Scope"
}
 
return subElements.size()

I want ask if there are the way to get number only closed outward linked issue?

Thank you for help!

 

1 answer

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

0 votes
Answer accepted
Yevgeniy Klyagin June 11, 2015

If someone need:

import com.atlassian.jira.ComponentManager
import com.atlassian.jira.component.ComponentAccessor
def componentManager = ComponentManager.instance
def constantsManager = ComponentAccessor.getConstantsManager()
Integer counter=0;
 
def issueLinkManager = ComponentAccessor.getIssueLinkManager()
def issueLinks = issueLinkManager.getOutwardLinks(issue.id)
  
def subElements = issueLinks.each {
    if(it.getIssueLinkType().getName() == "Project Scope" && it.destinationObject.getStatus().getName() == 'Closed'){
    counter+= 1
    }  
}
return counter
TAGS
AUG Leaders

Atlassian Community Events