Can not createCopy() on state done ?

Hello all,

I'd like to create a copy of a ticket when it becomes done to create a depending task. But the following code

rule needMarketingText 
when State.becomes({Done}) { 
  var nIssue = createCopy(); 

product the following message when state becomes done

Workflow opale-textsFlow reports error: Transaction is already being flushed!

Is their any work around ?

Thank's in advance
Thank you for the feedback, I created the bug JT-21659.

As workaround you can use the method loggedInUser.createNewIssue(project_name):
rule needMarketingText 
when State.becomes({Can't Reproduce}) { 
  var newIssue = loggedInUser.createNewIssue(project.shortName); 
  newIssue.summary = summary; 
  newIssue.Priority = Priority; 
  newIssue.Type = Type; 
  newIssue.State = {Submitted}; 
  newIssue.Subsystem = Subsystem; 
  newIssue.Assignee = Assignee; 
  newIssue.Fix versions = Fix versions; 
  newIssue.Affected versions = Affected versions; 
  newIssue.Fixed in build = Fixed in build; 
} (2.6KB)
We've discovered that the method 'createCopy()' is publicly available by mistake. So please use applyCommand("clone"); or loggedInUser.createNewIssue(project.shortName) to achieve issue copying in workflow.

Sorry for inconvenience.
Ok, thanks for the response.

@dmitry The applyCommand("clone") creates an issue with ??? as the issue number (i.e. SL-???). I'm trying to clone a newly issue when it's created and then move it to a different project. 

Can you help me?


Hello Bjorgensen, we can suggest the following: wait until the next release build and then try to use the method copy() instead:

Give it a try and then let us know if that helps. Thank you.


Please sign in to leave a comment.