Workflow for setting subsystem when a issue is created

I want to create a workflow when a new issue is created. But I'm a bit lost.

I think it would be along the lines of:

when isReported() && subtask of.isNotEmpty {
    issue.SubSystem = subtask of.first.SubSystem;
}

But no go, anybody knows?
2 comments
Comment actions Permalink
Hello, Fredric!

For me the workflow works good: when I create new issue with "subtask of," WF successfully updated Subsystem from the parent issue.
Did you attach WF to the project? What YouTrack version do you use?
Could you send us YT logs (email: youtrack-feedback@jetbrains.com)

best regards,
Mikhail
0
Comment actions Permalink
If you want the workflow to only go on issue creating, but not go on existing issues try becomesReported() condition:
rule subtask subsystem 

when becomesReported() && subtask of.isNotEmpty {
  issue.SubSystem = subtask of.first.SubSystem;
}
prettyPrint();
You may also desire set Subsystem on subtask adding for draft, in such case try this:
rule subtask subsystem 
 
when !isReported() && subtask of.added.isNotEmpty { 
  if (Subsystem != null) { 
    Subsystem = subtask of.added.first.Subsystem; 
  } 
}
prettyPrint();

Please clarify the behavior that you expect.
0

Please sign in to leave a comment.