It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Access development information from groovy script-runner in workflow transition


We are using JIRA Software, Bitbucket Server, Bamboo Server. I'd like to trigger a specific bamboo build after a JIRA workflow transition. To do these I want to gather additional information from the issue, like last successful build, assignee and.. Bitbucket branch.

I already tried access these data via script-runner as mentioned here but realized that this solution only applicable if we are using Bitbucket cloud or Github. It will not work if we work with Bitbucket Server

In general, I have a two ideas of how I can access development data(such as branch, pull-request, e.t.c):

  1. via Bitbucket application link
  2. via Java API of "jira-software-plugin"

The question is, where I can find an API of "jira-software-plugin" or can someone helps me with accessing data via application link?

Thank you,


7 answers

1 accepted

2 votes
Answer accepted

I, finally, found a solution of my problem!

import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.plugin.devstatus.api.DevStatusSummaryService
import com.atlassian.jira.user.ApplicationUser
import com.onresolve.scriptrunner.runner.customisers.WithPlugin

DevStatusSummaryService devStatusSummaryService = ComponentAccessor.getOSGiComponentInstanceOfType(DevStatusSummaryService.class)

ApplicationUser currentUser = ComponentAccessor.jiraAuthenticationContext.getLoggedInUser()

DetailBean pullRequestData = devStatusSummaryService.getDetailData(, "stash", "pullrequest", currentUser).get()


pullRequestData object will contain information about pull-requests and branches of the issue. You could use the same approach for accessing bamboo builds data as well.

Thank you all,

Hi Mikhail,

Glad you got it working. I came across that plugin while investigating this and it seems that you can't access the source code for it. It looks like its one of those you need to unzip the JAR for and decompile to see whats going on.

Nice use of @WithPlugin.


Thanks Mikhail for sharing this nice script.

I am using SVN sub-version and would like to get the branches of the issue(i,e to which are all branches JIRA issue Fix is submitted) using pullRequestData object. 

DetailBean pullRequestData = devStatusSummaryService.getDetailData(, "subversion", "pullrequest", user).get()

can you please suggest how to get the 'branches of the issue'(s) details and compare with one custom field to match with. Thanks. 

I added the script as part of project workflow scripted post-function and got the below output after adding the below line::

DetailBean pullRequestData = devStatusSummaryService.getDetailData(, "subversion", "pullrequest", user).get()


2016-12-13 16:44:44,497 DEBUG [workflow.ScriptWorkflowFunction]:[detail=[],errors=[],configErrors=<null>]

3 votes

Your best off tagging your question with com.onresolve.jira.groovy.groovyrunner to get a faster response. Not all of us follow the tags you mentioned or the tags in the questions you linked to.

It sounds like what you want to achieve can be done with a scripted post-function in JIRA. You will then need to call the bamboo REST API via an application link between JIRA and Bamboo to trigger a build. You can find examples here of interacting with other Atlassian applications.

The Bamboo REST API is documented here and the Bitbucket REST API is here.

Its just a case of putting it all together but hopefully this will give you an idea of how to approach this problem.

Hi Adam, thank you for the response.

Yes, I used scripted post function. Yes, I used application link to communicate with Bamboo. And there are no problems at this point.

The problem is on the issue "parameters", precisely pull-request, branch name, and changeset that available in the development panel(Jira Software). As I mentioned in the question, I see a few ways how to do this, but I don't have enough expertise to find a correct way smile 

DevStatusSummaryService devStatusSummaryService = ComponentAccessor.getOSGiComponentInstanceOfType(DevStatusSummaryService.class)

I tried this script but devStatusSummaryService is null. I checked that  plugin com.atlassian.jira.plugins.jira-development-integration-plugin is installed and all its modules are enabled. 

What else can be done?

I've found another way to get instance of DevStatusSummaryService:


def ccm = ComponentAccessor.getComponentClassManager()
def service = ccm.newInstance("com.atlassian.jira.plugin.devstatus.impl.DefaultDevStatusSummaryService")
def currentUser = ComponentAccessor.getJiraAuthenticationContext().getLoggedInUser()

def issue = ComponentAccessor.getIssueManager().getIssueObject("TEST-2")
def details = service.getDetailData(, "stash", "pullrequest", currentUser).right().get().getDetail()
Like Viktor Galunov likes this

The similar question was found here and it still without answer sad

Another question with this topic:

Related to Github and Bitbucket Cloud integration. Doesn't helps me smile

Are you sure it doesn't work for BB server? I think it does.

Hi Jamie,

"dvcsPullRequestService.getPullRequests(["MY_JIRA_ISSUE_ID"])" returns an empty result for my issue linked with Bitbucket server :(

As I understand, dvcs plugin is responsible for connections with Bitbucket cloud and github only.

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted in Off-topic

Friday Fun: Virtual dance party!

Do dance parties help you relieve stress? How about *virtual dance parties*? My team holds virtual dance parties to brighten the mood of a tough day or celebrate an upcoming weekend.  Want t...

147 views 20 8
Join discussion

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you