hi,
i tried to access the details of pull request assigned to an issue.
the following code get an NPE ... any ideas?
import com.atlassian.jira.plugin.devstatus.api.DevStatusSummaryService
def devStatusSummaryService = getComponent(DevStatusSummaryService)
def pullRequestData = devStatusSummaryService.getDetailData(issue.id, "stash", "pullrequest", currentUser).get()
NPE:
java.lang.NullPointerException: Cannot invoke method getDetailData() on null object
thanks, adrian
I'm afraid the DevStatusSummaryService doesn't exist anymore - see https://community.atlassian.com/t5/Marketplace-Apps-questions/Access-development-information-from-groovy-script-runner/qaq-p/623719
thanks for this link.
but at the end of the solution it's written: "I accessed everything i need through REST API". is there a way to call the REST API from JMCF with the credentials of current user?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Calling the REST API from a calculated field is really not a good idea, because it will have a significant impact on performance, especially during re-indexing.
It would be much better to ask Atlassian for the replacement API to the DevStatusSummaryService.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
but still works with this:
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(issue.id, "stash", "pullrequest", currentUser).right().get().getDetail()
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.