Workflow to create target issue and two subtask

Hi YouTrack community!

My use case: I want to create a workflow that generates a target issue with a fixed name and simultaneously create 3 other issue as subtask of the target. I want to do this by selecting an option in the list during a new issue action.

I try to do this with the workflow constructor by creating a workflow with an Action trigger, and in the action section, I added the following:

  • Creating an issue: with all parameters for my target issue
  • Link to another issue: I don't understand how it works. If I chose “Take from another block” for the Target issue, I can select the previous step, but how can I set up the subtask issue?

The Action trigger works fine to create a single issue with its parameters.

Is it possible?

Thanks a lot.

0
8 comments
Official comment

Hi Marco! You may select these workflow-created subtasks as target issues for link type “parent for”:

As the result of applying this action, two subtasks of the issue that you applied the action to should be created:

Thanks Stanislav Dubin for your response.

I have a question for you: what I see from your example are only two target tasks, or am I wrong?

I want to create somethings like this with a unique action.

Create a workflow with an action trigger that names “[ORD] Lavorazione QP” (in the follow image I try to execute your suggestion, not is the realy settings of the workflow):

Then I want to create an issue on demand by clicking the action during creation of new issue:


In the end I would like a structure of issues like this:

0

I've seen this solution, which I could adapt to my needs. What do you think? Would you help me modify it? I'm not very familiar with JavaScript.

https://blog.jetbrains.com/youtrack/2017/12/make-it-workflow-part-4-generating-new-issues/#generate-subtasks-when-a-parent-issue-is-submitted

0

Marco Tarantino the workflow from your screenshot should work as you described it. The only thing to note is that if you apply this action to the issue draft, you will get to see these issue links only after the issue is created (after clicking Create). If you want to create this workflow in JS instead, you can also do it, but so far, the task seems easy enough to be solved by the visual constructor.

0

Stanislav Dubin when I select the action that I configured on the new task page, I can't select Create because I want to create the task without adding a new one.
See screen below:
 

0

Marco Tarantino perhaps you expect that you can have the main issue created for you in live mode by applying this action. Workflows can't make actions for you in the UI, so while you can set up the workflow to create the parent task in the background, you won't see that as something that happens on your screen. So there could be two ways of going about it:

  • execute the workflow action, which will create the parent task and subtasks, then click cancel to exit the issue draft and view the newly-created issues on the Issues page;
  • set up the action to fill in the issue draft and create two subtasks—it can also display a message asking the user to click Create.

If I misunderstand you and you'd like to explain your idea in more detail, I suggest creating a support ticket.

0

Stanislav Dubin I have in your first way.

The action I configured works as you described: when I click on the option [ORD] Lavorazione QP, nothing appers immediately, but then I see the new ticket in the issue list.

The problem is that the ticket isn't created with a parent-subtask structure; instead, I see two separate issue with no link between them.

Below, I've included all the screenshots of my configuration:

“The other action, aside from [ORD] Lavorazione QP, are disabled”

then I click on the option:

And finally, this is the result I see in the issue list, where you can see that they are two separate tickets with no link between them (the option View Mode = Tree is selected)

 

0

Marco Tarantino I see now, thanks for the detailed explanation. The actions in the visual constructor are indeed designed to link issues that it can create to the issue that the action is executed in. So if you want to avoid using JS here, you can work around it by using two visual rules. An action rule will create the parent issue and add a special tag to it, and an on-change rule will be triggered by that event and will add a subtask to that parent task:

As a result, a parent and a subtask will be created:

0

Please sign in to leave a comment.