Community moderators have prevented the ability to post new answers.
I managed to get this working. The Javadocs for IssueConversionService.convertIssue() are not quite clear.
void convertIssue(JiraServiceContext context,
Issue issue,
MutableIssue updatedIssue)
It turns out that the second parameter (issue) actually needs to be a MutableIssue.
Otherwise you get this ...
java.lang.UnsupportedOperationException: We don't currently index workflowid - can't get it from document
at com.atlassian.jira.issue.DocumentIssueImpl.getWorkflowId(DocumentIssueImpl.java:388)
at com.atlassian.jira.bc.subtask.conversion.DefaultIssueConversionService.convertIssueDetails(DefaultIssueConversionService.java:329)
at com.atlassian.jira.bc.subtask.conversion.DefaultIssueConversionService.convertIssue(DefaultIssueConversionService.java:392)
at com.atlassian.jira.bc.subtask.conversion.IssueConversionService$convertIssue$1.call(Unknown Source)
And both MutrableIssue objects refer to the same issue before and after the conversion.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.