Links between sequential stories - Jira Automation

Herick Carvalho March 26, 2024

Olá a todos!!

Tenho um projeto automatizado que a partir da criação do Epic, gera varias historias e subtarefas dentro de cada historia. Cada historia criada vai ser bloqueada pela anterior, como segue na captura.

Capture_Padrao.PNG

Pela quantidade imersa de subtarefas a serem criadas, dividi as historias em regras individuais com gatilhos sequenciais. Quando configuro a historia para ser associada a ultima criada ela, não funciona e não aparece nenhum vinculo. 

Alguem poderia ter uma ideia do porque nao consigo vincular uma historia a ultima criada? Como seria a forma ideal de realizar essa demanda ??

Qualquer ajuda será apreciada. 

Obrigado!! 

 

----------------------------------------------------------------------

Hello everybody!!

I have an automated project that, after creating Epic, generates several stories and subtasks within each story. Each story created will be blocked by the previous one, as follows in the capture.

 /* first screenshot */

Due to the large number of subtasks to be created, I divided the stories into individual rules with sequential triggers. When I configure the story to be associated with the last one created, it doesn't work and no link appears.

Could anyone have an idea why I can't link a story to the last one created? What would be the ideal way to fulfill this demand??


Any help will be appreciated.

Thank you!!

1 answer

1 accepted

1 vote
Answer accepted
Bill Sheboy
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.
March 26, 2024

Hi @Herick Carvalho -- Welcome to the Atlassian Community!

For a question like this, please post an image of your complete automation rule, images of any relevant actions / conditions / branches, an image of the audit log details showing the rule execution, and explain what is not working as expected.  Those will provide context for the community to offer ideas.  Thanks!

Until we see those...

You describe splitting the issue creation across different rules.  As a result, the different rules do not have context / scope to access the other issues for linking.  If you can find the issues with JQL, you could use the Lookup Issues action to identify their keys to support the linking...although your rule timing of when the issues are created may make that difficult.

Kind regards,
Bill

Herick Carvalho March 27, 2024

Hi @Bill Sheboy   -- Thanks for the answer and sorry for the vague question.

Below is a capture of the pattern of my branching rule, where it is activated by the previous trigger and in sequence a history is created with its configurations and subtasks, and finally the summary trigger is created for the creation and execution of the next rule.

My attempts to create a sequential link between stories are as follows:

Attempt 1: I configured it within the story itself through the "Associated Items" field. The rule followed successfully but no link was created. I also tried to place an action to edit associated items in the story creation sequence and got the same result.

tentative4.PNG

  • Attempt 2: I created a branch for "Last item created" and a link was created with the main Epic, as follows in sequence.

tentative1.PNG

tentative5.PNG

  • Attempt 3: I added the edit link action within the subtasks branch and a link was created between all subtasks.

tentative2.PNG

tentative6.PNG

I hope I explained my problem and my attempts and results more clearly.

Bill Sheboy
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.
March 27, 2024

One challenge with linking created issues in rules is context: the definition of "most recently created issue" changes as issues are created, including more challenges if branches are used.

To do what you describe, you may need to either save the issue keys in variables or use separate rules to add the subtasks.

 

For a basic rule to add a series of linked stories, a rule would be this:

  • trigger: some trigger
  • action: create issue A
  • action: create issue B, adding a link to "most recently created issue"
  • action: create issue C, adding a link to "most recently created issue"

 

But to do that with sub-task creation also, the keys must be saved first.

  • trigger: some trigger
  • action: create issue A
  • action: create a variable to save {{createdIssue.key}} as varKeyA
  • branch: to most recently created issue
    • action: create subtasks for issue A
  • action: create issue B, adding a link to {{varKeyA}}
  • action: create a variable to save {{createdIssue.key}} as varKeyB
  • branch: to most recently created issue
    • action: create subtasks for issue B
  • action: create issue C, adding a link to {{varKeyB}}
  • branch: to most recently created issue
    • action: create subtasks for issue C

 

Like Herick Carvalho likes this
Herick Carvalho March 27, 2024

Thanks @Bill Sheboy--- It explained a lot to me about my problem. But I still have a doubt.

 

In my case, the stories are created in a rule individually. To use the story key in another rule (Rule B) I created the variable {{varKeyA}} and commented it in Epic and after triggering the next story I used {{issue.comments.first.body}} to define it. it as {{varKeyA}} in rule B and so I can theoretically use the variable from rule A in rule B.

  • Rule A

tentative8.PNG

  •  Rule B

tentative7.PNG

To follow the plan you described, you need to create problem B by adding a link to {{varKeyA}}. That part was beyond my knowledge. Could you help me with how I could add varKeyA as a binding object? Since the Blocked By field only shows "Last item created" and "Trigger item"

 

Bill Sheboy
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.
March 27, 2024

I am still unclear why multiple rules are needed for your scenario.  Would you please explain that?

 

How is the second rule B using that saved key?  If it is using it to create a link, the smart value can be entered for the key value when linking.

 

A final thought: using the comments to pass data this way is generally not a reliable solution.  The rule would need to be triggered on "Issue Commented" to confirm it is present, and it could be altered, deleted, or disrupted by any manual changes to comments.

Herick Carvalho April 2, 2024

I need several rules due to the extensive size of each Story, for example, Story A has 25 subtasks, adding the trigger actions plus restrictions for execution, I would easily reach the limit of 65 components if I combined rule A and B. For So, as a way of organizing the flow, I preferred to divide each story into a separate rule, but all within the same epic, since I have, for example, 12 stories and each one with its long list of subtasks, all triggered after creating an epic.

 

For the second question, for now I am not using the saved key from rule A in rule B precisely because I don't know how to link them using this key, could you guide me? Whether by smart value, link, or other possible logic, how could I obtain this link between rule A and B?

 

Regards!!

Herick

Bill Sheboy
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.
April 2, 2024

A smart value may be used in issue linking by typing in the smart value, and selecting it when it appears below the field.

If your rule is able to extract the issue key, such as from a comment, it can be used as described above.

 

Have you considered other approaches for this scenario?  Perhaps issue import would be better if the details of the subtasks are always the same.

Herick Carvalho April 2, 2024

The rule is being able to extract the key from the previous problem as expected, but I was unable to implement the logic as you described.

I am linking as follows:

 

tentative9.PNG

 

Remembering that {{varKeyA}} = key from the previous problem; {{varKeyB}} = Current problem variable.

 

I am using the additional field to create the link between stories, but I believe it is not the case because the log shows an invalid JSON format.

JSON used:

{
"fields": {
"labels": [
"bugfix",
"add": "tmsLink= {{addLinkedIssue '{{varKeyA}}'}}"
],
"Link Story A": {
"value": "red"
}
}
}

Bill Sheboy
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.
April 2, 2024

I am unclear what you are updating with that expression, but here is the syntax for adding / updating issue links with JSON in an automation rule:

https://support.atlassian.com/cloud-automation/docs/advanced-field-editing-using-json/#Linking-issues

Suggest an answer

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

Atlassian Community Events