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

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,467,512
Community Members
 
Community Events
177
Community Groups

Get issue keys in bamboo build with scriptrunner

we are currently experimenting with Script runner for Bamboo and would like to know how to get the issue keys that are part of the build.

2 answers

Apologies for the delay in responding.

I've assumed that the Jira issue keys your talking about appear in the "Issues" tab as "Linked Issues" on your build?

If so you'll need to replace the planKey in the example below and run the script below in the Script Console:

import com.atlassian.bamboo.build.JiraIssueResultsManager
import com.atlassian.bamboo.plan.PlanKey
import com.atlassian.sal.api.component.ComponentLocator

def jiraIssueResultsManager = ComponentLocator.getComponent(JiraIssueResultsManager)

def planKey = "KEY"

def issues = jiraIssueResultsManager.findJiraIssuesForPlanKey(new PlanKey(planKey))

issues.collect { issue ->
"$issue.issueKey, $issue.issueType.linkDescription, $issue.issueType.linkType"
}

That will show you the issue key, link description and link type.

Let us know how that goes.

Adam

Thanks Adam this help. One more this, how do i pass the plan key as parameter.

The example I posted should show you how that's done. The line your interested in is:

def issues = jiraIssueResultsManager.findJiraIssuesForPlanKey(new PlanKey(planKey))

Or do you mean how we put the plan key into the output along with the link types?

0 votes

@Adaptavist Supp : any resonse?

Suggest an answer

Log in or Sign up to answer
TAGS

Atlassian Community Events