Wrote a plugin to auto create several tasks linked to an Epic. Now trying to assign these created tasks to the Epic (I also link them but assigning them to the Epic makes it easier to use). I can see the "Epic Link" and "Epic Name" custom field values and noticed that Greenhopper is using IssueImp for the Epic Link custom field: XX-1234 (toString) class com.atlassian.jira.issue.IssueImpl (getCLass.toString)
I am using IssueInputParameters to create my tasks. Just using addCustomFieldValue on "Epic Link" to add the Epic Issue (Issue class) to indicate that these created tasks are in the Epic does not work. Using a MutableIssue of the Issue as data to store does not work either: error: no suitable method found for addCustomFieldValue(String, MutableIssue / Issue / Object
What is the right way to store a complex object like IssueImp or Issue as a custom field? I personally would store a key as link in a custom field but because this needs to work with Greenhopper I need to store it in the same format so I can't change that approach. Thanks!
Edit:
Examples were asked:
IssueInputParameters issueIP = this.issueService.newIssueInputParameters();
issueIP.setProjectId(projectID);
......
issueIP.setFixVersionIds(fixVersionId);
issueIP.setApplyDefaultValuesWhenParameterNotProvided(true);
issueIP.addCustomFieldValue("Epic Link", (Object) issueManager.getIssueObject("XX-1234"));
IssueService.CreateValidationResult issueinput = issueService.validateCreate(user, issueIP);
Compile error:
error: no suitable method found for addCustomFieldValue(String,Object)
Trying Issue:
issueIP.addCustomFieldValue("Epic Link", Issue);
will result in
error: no suitable method found for addCustomFieldValue(String,Issue)
Similar for MutableIssue