PageRenderTime 40ms CodeModel.GetById 18ms RepoModel.GetById 1ms app.codeStats 0ms

/src/test/resources/examples/RemainingWorkInLinkedIssues.groovy

https://bitbucket.org/sorin/jira-plugin-intellij
Groovy | 18 lines | 12 code | 6 blank | 0 comment | 2 complexity | 7aaec66726012d8fb07c646760765f6f MD5 | raw file
  1. package examples
  2. import com.atlassian.jira.ComponentManager
  3. def componentManager = ComponentManager.getInstance()
  4. def issueLinkManager = componentManager.getIssueLinkManager()
  5. def totalRemaining = 0
  6. issueLinkManager.getOutwardLinks(issue.id).each {issueLink ->
  7. if (issueLink.issueLinkType.name == "Comprises") {
  8. def linkedIssue = issueLink.destinationObject
  9. totalRemaining += linkedIssue.getEstimate()
  10. }
  11. }
  12. return totalRemaining ? componentManager.getJiraDurationUtils().getFormattedDuration(totalRemaining) : null