Hi Guys,
I am new to the development environment and learning to deal with groovy.
I am trying to create a post-function script that defines the version of the project that is being created in this script.
Another point is that I need the start and release dates of the version being created to be the same as the user will place on the create screen in a custom date collector type field.
Please help me, I crashed and I can't evolve anymore.
Thanks in advance.
Here's code so far:
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.Issue;
import com.atlassian.jira.project.version.VersionManager
import com.atlassian.jira.bc.issue.IssueService.IssueValidationResult
import com.atlassian.jira.event.project.VersionCreateEvent
def projectManager = ComponentAccessor.getProjectManager()
def project = projectManager.getProjectObjByKey("TCR")
def versionManager = ComponentAccessor.getVersionManager()
versionManager.createVersion(project.key + " " + issue.getSummary(), new Date(), "Release Criada Automaticamente pelo issue" + " " + issue.key, project.id, null)
def versions = versionManager.getVersionsUnreleased(issue.getProjectObject().getId(), false)
issue.setFixVersions([versions.first()])