|
|
|
[
Permlink
| « Hide
]
Alexey Shumkin [18/Sep/18 10:20 PM]
Unfortunately, I cannot get list of related issues (with the scripot above) during the build (th elist is empty). I can only get it AFTER the build (during promotion)
I've solved this with in the following way:
I promote (to "release-build" config) to a variable "GitLabIssueIDs" variable value which is calculated with the following script: ${groovy: import com.pmease.quickbuild.plugin.tracker.core.utils.TrackerHelper; import com.pmease.quickbuild.plugin.report.engine.metadata.ReportCategory; import com.pmease.quickbuild.plugin.report.engine.ReportHelper; import com.pmease.quickbuild.plugin.scm.gitlab.GitLabPlugin; import com.pmease.quickbuild.plugin.tracker.core.extensionpoint.Issue; ReportCategory category = ReportHelper.getCategory(GitLabPlugin.class); List<Issue> issues = TrackerHelper.getIssues(category, configuration, build.id, build.id, 0, 100, true); ArrayList<String> issueIDs = new ArrayList<String>(); for (Issue issue: issues) { issueIDs.add(issue.issueKey); \} String.join(" ", issueIDs); } then in a Update GitLab Issue step I use "GitLabIssueIDs" variable value as the "Issue keys" (Nota bene: a list must be a "space-separated" list) Now the created issue(-s) is (are) in related issues.
But there's a question now "How can I get its ID from the build step?". E.g. my workflow is the following: 1. First QB-config "beta-build" creates an application build and creates an task/issue in GitLab for a tester to test the build. 2. Tester tests the application. And if it's ok recommends the build and reassign the GitLab issue to a lead/release manager. 3. Lead/release manager receives a notification from GitLab and promotes the recommended build to "release-build" config which closes issue(-s) opened during "beta-build". In this workflow, how can I releated issues IDs from "release-build" config? Actually, I can pass them as a promoted variable from "beta-build", but how can I list them (in a script?) after creation? I've found the following https://support.pmease.com/PMEase/QuickBuild/topics/3143/how-to-get-the-list-of-issue-tracker-issues-for-a-build?0 but it is considering plugin development as I just want to list them in a standard step (somehow). |