Branch rule in already existing branch

Anders Ottosson August 9, 2024

Hello!

I'm creating automation in Jira and are currently creating a story with my rule.

Under that story I want one or more sub-tasks to be created.

Under some sub-tasks I want Acceptance Criteria's to be created.

 

The creation of the Story works fine.

Branch rule (For most recent created issue) works fine to create all the sub-task in the story.

But to create the Acceptance Criteria's under the sub-tasks I would need another Branch rule to import the template for the Acceptance Criteria's. But it is not possible to create a Branch rule in the 2nd level when creating automations. It is only possible in the 1st level.

 

Anyone know how to do this in an easy way?

2 answers

1 accepted

0 votes
Answer accepted
John Funk
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
August 9, 2024

Hi Anders - Welcome to the Atlassian Community!

Please share your rule here so we can give you better guidance. 

Anders Ottosson August 9, 2024

Hello and thanks for quick response.

 

Enough to share a screenshot or you want me to export the rule and post here? If screenshot enough, here it goes.

 

The issue with the below is that the Accept. Criteria's is placed in the Story and not the Sub-task.

I've tried to add the Accept. Crit. as a component in directly in the Sub-task when creating the rule, but it is not part of the components available.

 

2024-08-09_13h02_20.png

Marc - Devoteam
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 9, 2024

Hi @Anders Ottosson 

So this is not a Custom Test field where you add data.

This action is from a marketplace app, what app are you using?

It might be that this field can be filled within the creation of the subtask, or add a re-fetch action in between the creation and the import template

Anders Ottosson August 9, 2024

Yes "Import template" is a 3rd party extension. Someone added it to our Jira installation and it works when importing templates (where import our Accept. Crit. and Definition of Done from. I did not add the plugin called "Import template", so I'm not sure exactly what app it is. But it works when adding Acceptance Criteria's to issues.

The reason I'm using it and not adding the filed and populating it through "Choose fields to set..." is that the Acceptance Criteria's we are using is a list of checkboxes and that field is not available when searching for it under "Choose fields to set...".

The "Import template" plugin form looks like this:

2024-08-09_13h57_49.png

How would I do a "re-fetch action in between the creation and the import template"?

The optimal solution would be to be able to add a new branch after the creation of the sub-task and put the "Import template" in that. But as mentioned in the original question, adding branch seems only to be possible in the 1st level and not in the 2nd level.

Sorry if I'm not answering your questions the way you like, but Jira is a bit new for me.

 

Marc - Devoteam
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 9, 2024

Hi @Anders Ottosson 

There is no second branch option.

In the actions list their is a re-fetch option.

https://support.atlassian.com/cloud-automation/docs/jira-automation-actions/#Re-fetch-issue-data

What is the 3rd party app that is used?

John Funk
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
August 9, 2024

You can create the Sub-task right after the Story and not need to put it under a Branch. For the parent, you can use {{createdissue.key}}

Like # people like this
Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 9, 2024

Hi @Anders Ottosson -- Welcome to the Atlassian Community!

Adding to John's suggestion about directly adding subtasks without branching, I recommend first saving the created Story's key in a variable.  That will help if adding multiple subtasks.

For example:

  • trigger: issue created
  • action: re-fetch issue (I recommend always re-fetching after the Issue Created trigger to prevent racetrack errors.)
  • condition: summary contains Anders test
  • action: create issue for the Story
  • action: create variable, saving the {{createdIssue.key}}
  • action: create issue for a Subtask, setting the parent field to the variable
  • branch: to most recently created issue (In this case, the subtask)
    • action: Import template
  • ... repeat the above 3 steps for as many subtasks are needed

Kind regards,
Bill

Like Anders Ottosson likes this
Anders Ottosson August 12, 2024

Hello everyone!

 

The "Re-fetch issue data" and then create a new sub-task with this in "Additional fields" solved it:

{
"fields": {
"parent": {
"key": "{{createdIssue.key}}"
}
}
}

 

Thank you all for helping out with this. The bullet point list from @Bill Sheboy was the one that got everything in place for me.

 

Thanks,

Anders

Like # people like this
John Funk
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
August 12, 2024

Great! Glad to hear. 

0 votes
Marc - Devoteam
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 9, 2024

Hi @Anders Ottosson 

Welcome to the community.

As @John Funk mentions share your rule.

But if Acceptance Criteria is a field in the subtasks, you can set this field with content on creation of the issue.

Just state the information in the field when creating the subtasks.

 

Suggest an answer

Log in or Sign up to answer