Created
August 15, 2019 13:06
-
-
Save andyone/5b4027c475688a0a13fda1e53dfb80ab to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import com.atlassian.jira.component.ComponentAccessor | |
| import com.atlassian.jira.plugin.devstatus.api.DevStatusSummaryService | |
| def devStatusSummaryService = ComponentAccessor.getOSGiComponentInstanceOfType(DevStatusSummaryService.class) | |
| def currentUser = ComponentAccessor.jiraAuthenticationContext.getUser() | |
| def prData = devStatusSummaryService.getDetailData(issue.id, "stash", "pullrequest", currentUser).get() | |
| if (prData == null) { | |
| return 0 | |
| } | |
| def prInfo = prData.getDetail() | |
| def prCount = 0 | |
| prInfo.each { prSource -> | |
| def prList = prSource.get("pullRequests") | |
| prList.each { pr -> | |
| prCount++ | |
| } | |
| } | |
| return prCount |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment