Hi,
We are trying to create a portfolio plan from your portfolio java API.
But we can't figure it out to how to set a filter and set the other steps also.
Can you share us an example code piece or show how to fix below code?
Here is our groovy code:
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.MutableIssue
import com.atlassian.jira.project.Project
import com.atlassian.jira.project.version.*
import com.atlassian.plugin.PluginAccessor
MutableIssue issue = ComponentAccessor.getIssueManager().getIssueByCurrentKey("DPMO-2637")
Collection<Project> projectList = new ArrayList<>()
projectList.add(issue?.getProjectObject())
List<Version> versionList = ComponentAccessor.getVersionManager().getAllVersionsForProjects(projectList, true).toList()
Set<Long> unarchivedVersionList = versionList.findAll
{it.archived}
.collect
{it.id}
.toSet()
PluginAccessor pluginAccessor = ComponentAccessor.getPluginAccessor()
Class planDTOClass = pluginAccessor.getClassLoader().findClass("com.atlassian.rm.portfolio.publicapi.interfaces.plan.PlanDTO")
def planDTO = ComponentAccessor.getOSGiComponentInstanceOfType(planDTOClass)
def planDTOBuilder = planDTOClass.builder()
planDTO = planDTOBuilder.withTitle(issue.key.join("-",issue.summary))
.withExcludedVersions(unarchivedVersionList).build()
log.warn(planDTO.id)
Hi,
Plan API is read-only.
At the moment we just can't use it for create portfolio plan.
Hi,
Can anyone please give the details regarding how to creating the portfolio plan using scrptrunner?
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.