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:
void setFixVersions(Collection<Version> fixVersions)
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.
Hello @Damian Wodziński
IssueInputParameters doesnt have method .setFixVersions()
You should use .setFixVersionIds() instead.
Error code:
2018-08-09 12:33:03,189 ERROR [runner.AbstractScriptListener]: ************************************************************************************* 2018-08-09 12:33:03,194 ERROR [runner.AbstractScriptListener]: Script function failed on event: com.atlassian.jira.event.issue.IssueEvent, file: <inline script> groovy.lang.MissingMethodException: No signature of method: com.atlassian.jira.issue.IssueInputParametersImpl.setFixVersions() is applicable for argument types: (java.util.ArrayList) values: [[2018_R12.0]] Possible solutions: setFixVersionIds([Ljava.lang.Long;), getFixVersionIds() at Script215.CreateSubIssues(Script215.groovy:62) at Script215.run(Script215.groovy:247)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.