Forums

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

Auto create tasks that related to the story

Jessie Li December 27, 2022

Hi there,

I want to automatically create 3 tasks when create the story.

for example

>create story "change the login flow"

>automatically create tasks of

  1. "iOS-change the login flow"

  2. "Android-change the login flow"

  3. "server-change the login flow"


and these tasks will related to the story.

 

I use the automation function but I don't know how to write the json of it, because I cannot figure out the smart value of the parent story. this is my current automation setting.


screenshot-20221227-211658.png

 

3 answers

1 vote
Ste Wright
Community Champion
December 27, 2022

Hi @Jessie Li 

You can do this without JSON - I've assumed for this example:

  • Tasks are not children of Stories
  • The "iOS / Android / Server" are to be added to the start of the original Story's Summary

If this is correct, see below...

---

The rule will look like this...

  • Action: Issue Created
  • Condition: Issue Fields Condition
    • Field = Issue Type
    • Condition = equals
    • Value = Story
  • Action: Create Issue
    • Project = Same Project
    • Issue Type = Task
    • Field - Summary = iOS - {{triggerissue.Summary}}
    • Field - Linked Issues = <<link issue type>>, Trigger Issue
  • Action: Create Issue
    • Project = Same Project
    • Issue Type = Task 
    • Field - Summary = Android - {{triggerissue.Summary}}
    • Field - Linked Issues = <<link issue type>>, Trigger Issue
  • Action: Create Issue
    • Project = Same Project
    • Issue Type = Task 
    • Field - Summary = Server - {{triggerissue.Summary}}
    • Field - Linked Issues = <<link issue type>>, Trigger Issue

---

^ A few notes on this approach:

  • Field: In the above "Create Issue" Actions, this is selection of a Field's name from the drop-down provided. The italic text then goes into the Summary's text box.
  • Linked Issues: You can set this from within the "Create Issue" Action, and shorten your rule!
  • Smart Values: To allow for additional information to be added to the start of the Summary, I've used a Smart Value to use information from the Trigger Issue. You can do this for most other fields also
  • Copy From: If the data is a direct copy from the Story, you can use "COPY" instead. To do this...
    • Select the Field to set data within, then press the breadcrumbs icon next to it (3-dots icon)
    • Select COPY
    • Click on the new box to select what Issue (eg. Trigger Issue) and what field to copy the information from
  • Sub-task: If these should be Sub-tasks, you can change the "Issue Type" in the "Create Issue" Action. It'll then give you a choice of what the Parent should be, and you can select "Trigger Issue"

---

Let us know how this goes, and if you need any further information :)

Ste

Jessie Li December 28, 2022

Hi Stephen, 

Thanks for your answer. It works well. 
But I also want to make the task in the same sprint with the story. I set the field "sprint"= {{triggerissue.Sprint}}, however the task created doesn't has a sprint. Could you tell me what's the problem?

 

Thank you.

Jessie

Ste Wright
Community Champion
December 28, 2022

Hi @Jessie Li 

Sprint works off ID in Automation - so if you change the Smart Value to...

{{triggerissue.Sprint.id}}

...it should work!

---

You can also use the simpler "Copy From" option here though.

To do this, within your "Create Issue" action...

  • Add the Field - Sprint
  • When the field appears, click the breadcrumbs (3-dots icon) next to the box to populate
  • Select COPY
  • Click on the new option which appears (should be something like "Copy Sprint from Current Issue")
  • Set the "Issue to copy value from" to be Trigger Issue

This should also work.

---

Let us know if you have any further questions!

Ste

1 vote
Walter Buggenhout
Community Champion
December 27, 2022

Hi @Jessie Li,

Most likely, there is no json required to set field values. You can copy values from the trigger issue just like this:

Screenshot 2022-12-27 at 16.40.46.pngJust select the fields you want to fill out. With the ... link next to each field select copy from and then update the selected option to copy ... from trigger issue as you can see in the above screenshot.

Hope this helps! 

Jessie Li December 28, 2022

Thanks Walter, it's solved. 😊

0 votes
Ravi Sagar _Sparxsys_
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.
December 27, 2022

Hi @Jessie Li 

You need to use JSON for setting fields not supported yet by the automation. In your rule you are already setting Summary to "ios". You can also set other fields like this.

Ravi

Jessie Li December 28, 2022

Thanks Ravi, it's solved. 😊

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
FREE
TAGS
AUG Leaders

Atlassian Community Events