Get the repository and branch names from the development panel.

Mauricio Garcia Valli August 10, 2020

I am trying to get the repository and branch names from the development panel. I got this code from another post which is trying to accomplish a similar thing:


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

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-1")
def details = service.getDetailData(issue.id, "stash", "pullrequest", currentUser).right().get().getDetail()

------------------------------------------------------------------------

 

But, this 2 imports aren't supported anymore.

import com.atlassian.jira.plugin.devstatus.api.DevStatusSummaryService and
import com.atlassian.jira.plugin.devstatus.rest.DetailBean

 

Searching for this, seens like devstatus have been discontinued and that is why this code isn't working anymore.

Does anyone know a way for me to get the repository and branch names from an issue in Script Runner? My goal is the create an custom field named "Repository" and another named "Branch" in which i will put the repository and branch names, so i can more easily access this information from Jira.

 

Sorry for any mistakes in the vocabulary, English isn't my first language.

1 answer

0 votes
Saravanan Sekar August 9, 2022

Hi @Mauricio Garcia Valli Do you got any lead on this we are trying to do the same. Kindly let me know if you got any suggestions. Thanks 

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events