Automatically create Stories linked to an Epic using standard Checkbox field

Platform Notice: Cloud Only - This article only applies to Atlassian products on the cloud platform.

Summary

This article shows a workaround that makes it possible to automatically create Stories based on creating a checkbox-type field and selecting specific values in it.

This might be important in case you have a couple of default fields that always need to be set differently.

Solution

The proposal here is to have a rule that's going to be triggered from the Epic issue by selecting the number of issues to be created based on the value selected of a specific checkbox field.

  • Create a standard Checkbox field on JIRA adding a couple of options ("one", "two", "three" for example);

  • Go to your rule list in Automation for JIRA and start creating a rule;

  • Select the "Field value changed" trigger and configure it as below:

    Image 1

    • Note: My checkbox field is called "Create Story";

    • Note 2: You can also select specific issue operations, as "Create Issue", in order to trigger this rule only when an issue is being created, for example.

  • Add an Issue fields condition to filter out the "Epic" issue type, as below:

    Image 2

    • Note: This will allow the next actions to be performed only if the change on the "Create Story" field was made on the Epic;

  • Add an If / else block condition:

Image 3
  • Inside of the first If: matches condition, select an Advanced compare condition:

    Image 4

    • Note: This section will include some Smart Values in order to make the comparison possible;

    • The Advanced compare condition on the If : matches section should look like this (more details after the image):

    Image 5

  • Smart value used: {{#changelog.Create Story}}{{toString}}{{/}}

  • Note: This smart value will look into the history of the issue that triggered the rule (the Epic) and will search for any changes on the checkbox field that ended up on it having the "One" as one of the selected checkboxes;

  • Note 2: Change the "Create Story" section of the smart value to match the checkbox field name you've created on your JIRA.

  • Into the If : matches section of your rule, add a Create Issue action, this will be the Story issue created automatically:

Image 6
  • Here is where you can set the issue fields to have the values you'd expect, in case there's any standard;

  • Note: Please select the "Epic Link" field on the "Choose fields to set..." dropdown and set it with the "Trigger Issue" value, this will link your Story that's being created with the Epic that triggered this whole automation rule.

So far, we have covered the use case that is used when we select the value "One" in our Checkbox field.

This is the whole rule structure explained so far:

Image 7

Now let's add the second condition to match with the value "Two" on the Checkbox field and create two stories from there.

  • After the If: matches section of your rule, click on the Add else button to start adding a new condition:

Image 8
  • Then, select a new Advanced compare condition inside of the Else-if: matches block that starts showing up after creating the new condition:

    Image 9

    • Smart value used: {{#changelog.Create Story}}{{toString}}{{/}}

    • Note: This smart value will do a similar task as the one into the first condition on the if/else block, but it will search for any changes in the checkbox field that ended up having "Two" as one of the selected checkboxes;

    • Note 2: Change the "Create Story" section of the smart value to match the checkbox field name you've created on your JIRA.

    • And then, following the same logic as before, you can add two Create Issue actions inside the Else-if: matches block on your rule and select the fields as you need to follow your business standards.

    • For example, as below:

    Image 10
  • Rule Configuration Spoiler:

Image 11
  • Now that we ran through the whole rule logic, you can replicate this for as many options as you insert in your Checkbox field.

    Additionally, if you want to clean up the Checkbox field after the rule execution, please add the following Edit Issue action after all the other rule components you have there (Conditions and Actions):

    Image 12

  • By adding the Create Story field (our checkbox field) and keeping it without any values on the action configuration, we'll be cleaning the field value itself.

    Image 13

    {code}{{#changelog.Create Story}}{{toString}}{{/}}{code}

Updated on July 11, 2024

Still need help?

The Atlassian Community is here for you.