applyCommand("clone") issue

1) The applyCommand("clone") creates an issue with ??? as the issue number (i.e. SL-???).

2) I'm trying to clone a newly created issue when reported and then move it to a different project.

Can you help me?

This is what I have so far....

rule Clone ST3 issues

when issue.isReported() {
applyCommand("clone");
}

2 comments
Comment actions Permalink
Official comment

Hello Bjorgensen, we can suggest the following: wait until the next build is released (please watch the announces of new builds) and then try to use the method copy() instead: https://www.jetbrains.com/help/youtrack/incloud/2017.1/Workflow-Language-Methods.html#copy

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

Comment actions Permalink

FYI I created a Stateless Rule to Clone issues and Tag (then remove that tag and add a new one from the original issue) when reported in a specific project. Then I have a Schedule Rule that runs every minute to move that Cloned issue to a specific project, remove the tag and add a new one.

Basically, I'm using a tag to identify the cloned ticket to later modify it via a Schedule Rule.

 

STATELESS RULE:

rule Clone issues

when issue.isReported() {
addTag("CLONE");
applyCommand("clone");
removeTag("CLONE");
addTag("Cloned");
}

 

SCHEDULE RULE:

schedule rule Move CLONE Tag 

cron: 0/15 * * * * ? [for all issues] {
if (hasTag("CLONE")) {
applyCommand("move to blah");
applyCommand("remove tag CLONE");
addTag("Cloned");
}
}

0

Please sign in to leave a comment.