Hello, I do not know why it is not working.
There is some of my code:
def project_key = "RM"
MutableIssue issue = issue
Long project_id = 13713
IssueService issueService = ComponentAccessor.getIssueService();
IssueInputParameters issueInputParameters = issueService.newIssueInputParameters();
void CreateSubIssues(IssueInputParameters iip, Long ProjectID, IssueService issueService, Issue issue)
{
def key = issue.getKey();
def reporter = issue.getReporterId();
MutableIssue missue = ComponentAccessor.getIssueManager().getIssueObject(key);
Long parent_issue_id = missue.getId();
def parent_issue_summary = missue.getSummary();
def linkMgr = ComponentAccessor.getIssueLinkManager();
def sequence = 0;
def wasIndexing = ImportUtils.indexIssues
def currentUser = ComponentAccessor.getJiraAuthenticationContext().getLoggedInUser()
Collection<Version> fixVersion = new ArrayList<Version>()
fixVersion = issue.getFixVersions()
//def field = ComponentManager.instance.getFieldManager().getOrderableField("fixVersions")
def declared_summarys = ["Release Management: ","Scope Registry: ", "Infrastructure Support: ", "UAT Implementation Plan: ", "UAT Implementation Meeting: ", "UAT Fix Registry: ", "System Unavailability Communication: ", "PROD Implementation Plan: ", "PROD Implementation Meeting: ", "PROD Fix Registry: ", "Risk/Problem Registry: ", "Lessons Learned Registry: ", "Report: "]
for(int i = 0;i<13;i++)
{
if(i==0)
{
iip.setProjectId(ProjectID)
.setAssigneeId(issue.getAssigneeId())
.setIssueTypeId("3")
.setSummary(declared_summarys[i]+parent_issue_summary)
.setReporterId(issue.getReporterId())
.setDescription("")
.setStatusId("10022")
.setPriorityId("4")
.setFixVersions(fixVersion)
}
But this does not work, is shows that [State type checking] - Cannot find matching method. Please check if declared type is right and matching method exist.
In the API i found this:
setFixVersions
void setFixVersions(Collection<Version> fixVersions)
- Parameters:
fixVersions - A collection of fix-for Version objects.
I am trying to set FixVersions on subIssues the same as FixVersion in parent issue when creating one.