Automatically create Stories linked to an Epic using standard Checkbox field

Still need help?

The Atlassian Community is here for you.

Ask the community




Unable to render {include} The included page could not be found.

Purpose

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

This might be important in case you have a couple of default fields that always needs 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:

    • 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:

    • 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:
  • Inside of the first If: matches condition, select an Advanced compare condition:
    • 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):

      • 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:
    • 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 covered the use case that is used when we select value "One" on our Checkbox field.

This the whole rule structure explained so far:

Now let's add the second condition to match with 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:


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

    • 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 on the checkbox field that ended up on it having the "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:



Now that we ran into the whole rule logic, you can replicate this for as many options as you insert on 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):

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




DescriptionAutomation for JIRA rule explanation that automatically creates stories from Epics based on the selection of a checkbox field
ProductAutomation for JIRA


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

Last modified on Nov 11, 2020

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.