You should add work items copying after copying the issue itself. What you need to do, is to copy ctx.issue.workItems into new issue workItems set (something like newIssue.workItems). Please refer to https://www.jetbrains.com/help/youtrack/standalone/v1-Set.html to find out how to handle sets.
Hi,
Do you mean cloning issue using `Clone` command? Unfortunately no, it works as designed - this work has not been actually done for the cloned issue.
However, you can clone work items using workflows (ctx.issue.workItems set represents all issues workflows).
Hi Ana,
As I’m not familiar with Youtrack workflow, would you please tell me step by step?
for example: which type of workflow do I need?
After create and attach to project should I doing something else? Or it work when I clone issue automatically?
Thanks,
Hi,
This should be an action rule (https://www.jetbrains.com/help/youtrack/standalone/Workflow-Rules.html#action-rules) which will create a copy of the issue when applying some command (e.g. "cloneIssue"). Please don't use "clone" command as this keyword is reserved for the default clone action.
You should add work items copying after copying the issue itself. What you need to do, is to copy ctx.issue.workItems into new issue workItems set (something like newIssue.workItems). Please refer to https://www.jetbrains.com/help/youtrack/standalone/v1-Set.html to find out how to handle sets.