Forums

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

Jira automation to check siblings condition to edit parent

Neville August 21, 2023

For example, 

I have two Stories under same Epic.

Epic A

Story A 
Story B

 

Scenario A

If Story A move the status to Done and contain label A Then
 
     if Story B contain label A Then

           Epic A add a Label C

How should I do it?

Million Thanks.

 

1 answer

1 accepted

2 votes
Answer accepted
Mark Segall
Community Champion
August 21, 2023

Hi @Neville 

Can you please elaborate on this one?

I understand that when Story 1 has label A transitions to Done, you want Epic 1 to be tagged with a specific label.  Where I can use additional context is in the role of Story 2

It the intention to run a condition against the status of Story 2 and if NOT resolved, you want the Epic to be tagged with a specific label?

Neville August 21, 2023

Yes.

 

For example, I have a Story called Research and a Story called Analysis.

 

For example

I want add a label to Epic in( research done, Analysis done and ready for refinement ) based on the Story status. So that I can generate the report

Mark Segall
Community Champion
August 21, 2023

Thank you for clarifying. You could do this:

  • TRIGGER: Issue Transitioned (To Done)
  • IF CONDITION: Labels contains (Research)
    • BRANCH: Epic (Parent)
      • ACTION: Edit Issue
        • Labels (Add)
          • Research_Done
  • ELSE: Labels contains (Analysis)
    • BRANCH: Epic (Parent)
      • ACTION: Edit Issue
        • Labels (Add)
          • Analysis_Done

If you're dealing with more than a couple types of stories, you could do something a little more intricate by changing how you tag the stories to include the story type in the summary (e.g. Research: Story 1, Analysis: Story 2).  This will allow a more simplistic rule:

  • TRIGGER: Issue Transitioned (To Done)
  • BRANCH: Epic (Parent)
    • ACTION: Edit Issue (Add Labels)
      • {{triggerIssue.summary.substringBefore(":")}}_Done

This rule reads in the type of story and appends _Done to the end of it to give you "Research_Done" as an example.

Neville August 21, 2023

hi @Mark Segall 

Screenshot 2023-08-22 at 3.32.04 PM.png 


I created this rule. In general , it's work. But it not very stable. Seems it is because it will run all cases I have.

How can I modify it to

If
else if
else if 

but not 

if 
if 
if

Thanks 


Mark Segall
Community Champion
August 22, 2023

When selecting conditions, there's an IF/Else condition.  You want to start your first condition with that and then next the branch under it and I just realized my last response was incorrect.  It should look like this:

  • TRIGGER: Issue Transitioned (To Done)
  • CONDITION: Issue Type is one of (Task, PD, CD)
  • IF CONDITION: 
    • Labels contains Analysis
    • BRANCH: Epic (Parent)
      • Edit Issue: (labels)
        • Add Analysis_Done label
  • ELSE CONDITION
    • Labels contains Research
      • Edit Issue: (labels)
        • Add Research_Done label

Sorry about the miscue on my last response.

Like # people like this
Neville August 22, 2023

Thanks~~

Like Mark Segall likes this

Suggest an answer

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

Atlassian Community Events