Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Jira Automation with subtasks

khairnar_dhaval March 16, 2022

I have created one issue with couple of subtasks. Now I want to create this issue type along with subtasks on every month. I have tried to create a automation rule but did not work. Please suggest how I can create a recurring issues with the same set of issue and subtasks within. thanks

Screen Shot 2022-03-17 at 10.15.42.png

1 answer

1 accepted

3 votes
Answer accepted
Stefan Salzl
Community Champion
March 17, 2022

Hi @khairnar_dhaval 

If there is no JQL in the scheduled trigger the rule could not reference any issue. (as other rules are often triggered by an issue this issue key then is in the context of {{issue}} for the rule like kinda variable)

I would suggest following approach (built that in my system):

  • add a jql to the trigger that only looks for the key of the parent you´d like to clone (this will bring the original/template issue into {{issue}} context)
  • clone that one
  • branch for sub-tasks
  • action: clone issue
    • fields in JSON needs to be configured to point to new parent which in this case is the recently created issue --> can be done with smart value

image.pngimage.png

Hope this helps.

Best
Stefan

khairnar_dhaval March 17, 2022

Thanks @Stefan Salzl I have tried with the Json fields that you have given in the screenshot but it throughs some error. Please look into and suggest.Screen Shot 2022-03-17 at 17.30.22.png

Stefan Salzl
Community Champion
March 17, 2022

Hi @khairnar_dhaval 

In case anything doesn´t work please consider to document and add screenshots and other docs (like in this case the JSON). This would be necessary and helpful to analyze the problem and find a solution.

Guess there is just some misspelling or some characters missing in the JSON.

Best
Stefan

khairnar_dhaval March 17, 2022

@Stefan Salzl not able to understand what issue exactly is. I have tried by manually creating subtasks for each subtasks as well but it goes to parent ticket from which I am trying to clone. 

Stefan Salzl
Community Champion
March 17, 2022

Sure. That´s the correct behaviour. The "parent" option in the issue´s json will stay the same as the system cannot know by itself where to link the issue. By cloning it copies original issue´s setting (expect they were changed by the automation as made in the suggested approach):

again: if you´d like to go for a solution

please consider to document and add screenshots and other docs (like in this case the JSON). This would be necessary and helpful to analyze the problem and find a solution.

Best
Stefan

Stefan Salzl
Community Champion
March 17, 2022

That´s the JSON I used in "clone issue" action for subtasks:

{

    "update": {

        "labels": [

            {

                "add": "cloned"

            }

        ],

        "issuelinks": [

            {

                "add": {

                    "type": {

                        "name": "Cloners"

                    },

                    "outwardIssue": {

                        "key": "{{issue.key}}"

                    }

                }

            }

        ]

    },

    "fields":

        {

        "parent":

            {

            "key": "{{createdissue.key}}"

            }

        }

}

 

In case your rule is exactly configured as suggested above this could be copied to your "clone subtask" action.

Best
Stefan

khairnar_dhaval March 18, 2022

Thank you so much @Stefan Salzl  it worked. There was one small difference I did not noticed before. I created new brach instead of main component. Thanks a lot again.

Like Stefan Salzl likes this

Suggest an answer

Log in or Sign up to answer