How to identify Clone event?
Answered
How to identify issue is created by cloning button or from simple new create button? I want to emptied some custom fields if issue is created by cloning. Please help
Please sign in to leave a comment.
Hi Mali,
thank you for your question and sorry for the delay.
At the moment you can't identify a cloned issue or edit the Clone Issue workflow (which actually makes cloning possible).
We are currently working on a new workflow paradigm, and when we release it, editing Clone Issue workflow will be possible, and you will be able to change some custom fields when cloning.
Please let me know if I can answer any further questions.
As for the creation of a new issue via Create button, of course you can use our workflows for any kind of automated change at the time of creation: https://www.jetbrains.com/help/youtrack/incloud/7.0/Workflow-Overview.html
All,
To get around the system not being able to identify a cloned event.... 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 PROJECT NAME");
applyCommand("remove tag CLONE");
addTag("Cloned");
}
}
@Liubov Dievskaia you mentioned this in your original reply:
"We are currently working on a new workflow paradigm, and when we release it, editing Clone Issue workflow will be possible, and you will be able to change some custom fields when cloning"
Was this released in 7.2?
Hello Bjorgensen, thanks for the question!
Yes, we've already released new JavaScript based workflows as an experimental feature, you can try them out! More here: https://www.jetbrains.com/help/youtrack/incloud/2017.2/Workflows-in-JavaScript.html
Thank you, Liubov! So the previously 'read-only' Clone Issue workflow will be editable? I have 7.2 queued up with my development team for install.
That's correct, you'll be able to edit the Clone Issue workflow, and also you'll be able to create custom action rules. Please feel free to provide any feedback once you upgrade and enable this experimental feature! Thanks.
Liubov - I want to automatically relate/link a cloned issue to the original. Can you provide some guidance on how I can make this happen?
Hello,
Do you want to do it with the workflow? Did you try to create one already?