Hi,
I’m trying to clone issue and then changing issueType in the issue clone and I’ve 2 kinds of problems.
The 1st:
my issue is cloned by a custom class extending CloneIssueDetails.
In my doExecute() implementation, soon after having called the super.doExecute(), I’m not able to get the cloned issue but I need it to do some operations on the clone.
I made a workaround for this problem, using a customField that can help me to understand if it’s my issue clone, triggered on the ISSUE_CREATED event and then reading this cf.
Is there any other way to know which is the issue clone just after cloning an issue ?
The 2nd big (worst) problem is that I need to change issueType on the issue clone.
To do this, when I’m called by the ISSUE_CREATED event, I change the type to the issue and then I call the
workflowManager.migrateIssueToWorkflow(issue, newWorkflow, status);
but I got the following error:
Can’t transition workflow instance #175310. Current state is 3, requested state is 1
even if the issue is anyway created. I’ve seen that when I’m called by ISSUE_CREATED event, the workflow of the new issue clone is not yet activated (maybe the new issue is not yet completely ready?)
So has anyone any suggestion on how to change issueType on a newly created issue clone ?
Thank you.