Automation for Jira - Use Checkboxes to Create and Link Issues

jeff_l_taylor June 14, 2022

We have two custom Issue Types, which have a parent child relationship.  The parent Issue has a checkbox field that allows the users to select the child Issue that will be created and then linked to the parent.  Multiple children can be selected and linked to the parent.  I have an automation in place that when a parent is Created the selected children Issues will be created and linked to the parent.  It works as expected.

My question is regarding editing the parent Issue.  I need to create an automation rule that allows the user to select or deselect a checkbox and either create and link the child Issue, or unlink the child issue if deselecting the checkbox.  I am trying to figure out the Condition that should be used to uniquely identify the checkboxes that have been selected or deselected during edit, then use the Action to perform the linking or unlinking.

1 answer

0 votes
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.
June 14, 2022

Hi Jeff - Welcome to the Atlassian Community!

Can you share the rule that you have already?

jeff_l_taylor June 15, 2022

I am unable to post a screen shot or other information, but I will diagram the Rule that is working.  The Rule that is working is to create and link child Issues to the parent Issue when a parent Issue is created.

Issue Created:                         Trigger

If Issue equals Issue Type:        Condition

Branch Rule

      if checkbox equals Value_1      Condition

      then Create new Issue and link to parent         Action

Branch Rule

      if checkbox equals Value_2       Condition

      then Create new Issue and link to parent         Action

Branch rule

      if checkbox equals Value_3        Condition

      then Create new Issue and link to parent          Action

 

This continues for each of the available Checkbox values.  During the creation of the parent, 1 or all of the checkboxes can be select to create the Issues and link them to the parent.  This is working for the Create operation.

I am not sure exactly how to do the Edit operation.  I would like the Checkbox field of the parent Issue to control when a Child Issue gets created and linked.  Also, I would like the Checkbox field to also unlink the Child Issue if the Checkbox is deselected, if that makes sense.  The Rule I had in place for the Edit operation did create new Issues and link them, but it also created Issues for the already checked Checkboxes.  I am reviewing smart value options to determine if I can isolate the new checkboxes that have been selected and those that have been deselected.

      

jeff_l_taylor June 15, 2022

I have some additional information, which includes partial success.  As I mentioned, the Rule that is triggered when the parent Issue is created is working.  The user selects the checkboxes for the child Issues that they would like created.  They can select 1 or all of the checkboxes and the child Issues will be created and linked to the parent Issue.

The Rule that I was attempting to figure out is now partially working.  The Rule is for a Change Value for the Checkbox field.  The Checkbox is on the parent Issue.  The operation is when the Checkbox is edited.

I am using the Advance Compare Condition.  The Rule is as follows:

Trigger: Value Changed for the Checkbox field

Condition: Parent Issue Type

Branch Rule:

       Advance Compare:  {{fieldChange.toString}} Contains Value_1

       Advance Compare:  {{fieldChange.fromString}} Does not Contain Value_1

       Action:  Create and link child Issue

Branch Rule:

       Advance Compare:  {{fieldChange.toString}} Contains Value_2

       Advance Compare:  {{fieldChange.fromString}} Does not Contain Value_2

       Action:  Create and link child Issue

and so on ...... until all of the available checkbox values have been considered.

The Rule is essentially looking at the previous checkbox values with the current checkbox values and I am stepping through each possible selection to see if a new checkbox value has been selected.  This seems to be working.

I now need to check to see if the checkbox values have been deselected so that the Rule can automatically unlink the child Issue from the parent Issue.  For this particular case, we need to use Issue Linking rather than Sub-Tasks.

Suggest an answer

Log in or Sign up to answer