Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,365,059
Community Members
 
Community Events
168
Community Groups

Multiple issues in one Workflow

Hello,

I'd like to build a workflow that includes multiple issues depending on one another.
So issue A is opened manually, this should trigger that issue B is automatically created.
When issue B is closed, this should trigger an automatically created issue C and with that closed, issue D should be triggered.
Can I build such a thing in one workflow or do I have to build a separate workflow for each issue?

2 answers

1 accepted

3 votes
Answer accepted

You could do this in a single workflow, but you do need to think carefully about how to end the chain and if it really is appropriate.

If for example, you go with a very simple setup - all the issues are in the same project and use the same workflow of "to do -> in progress -> done", and you have a simple "create new issue" scripted post-function or automation that runs on "in progress -> done", it will do what you describe.

When A moves to done, B gets created in to-do, when that goes to done, C will be created, and so on.  Infinitely.  Is that really what you want?   You'll need to think carefully about how you limit the chains.

One of my projects did exactly this, but they had a field for something like "step" which had three possible values.  A was created with it empty.  When the create script ran, it checked the step on the current issue, and set the step to the first value on B as it created it.  When B closed, the same script saw the value was the first value, so it created C with the next step value on it.  And so on.  When it got to the last step, it stopped creating issues.

I've seen it done with a simple counter as well (this issue is 3 in a chain of creates, so create the next one with 4 in the counter)

There are variants - different workflows for different issue types, creating issues in different projects and so on.  But the short answer is "yes, you can do this" and it's not as scary as it might look.  Just think about the end of the chain (although you might not need too - one team I'm working with have done this for tracking repeat tasks - they're creating issues that they will always have to work on in a sprint, one issue per sprint!)

Okay, that sounds good...
So the plan is to have an issue that is manually created and triggers issue A that has a to-do-list in it.
With that closed, issue B should be created with a different to do list.
And last, issue C has another to-do-list.
After that, the Workflow is done and should stop creating issues.

So if I find out how to build such a "step" field, I can build a workflow that creates an issue with the to-do-list of A when "step" is empty, an issue with the to-do-list of B if "step" has the first value, an issue with the to-do-list of C if "step" has the second value and then stops creating issues?

Yes, that's exactly it! 

The step field can be any type of custom field, my examples were of a simple number and a select list - you'll be able to script/automate with either very easily, and you could use others like plain text.  (I prefer select-lists, they make reporting easy because you can do stuff like pie-charts and group-by with them)

You don't even need to add the step field to any screens.  I'd actually recommend only putting it on "view", so that people can't change it manually.

In Jira workflow is a path, that single issue can move from creation to completion. Transitions from statuses can trigger certain actions, but it would require other tools.

Check Jira Automation to build your own logic for issue creations:  https://www.atlassian.com/software/jira/features/automation

Here you can explore some common cases: https://www.atlassian.com/software/jira/automation-template-library/most-popular

Suggest an answer

Log in or Sign up to answer