Forums

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

Buscar a maior "due date" dos Itens "Filho"

Vinícius Pereira
Contributor
May 2, 2025

Pessoal, boa tarde!

Tenho o Jira Premium e uma estrutura de Épicos (pai) e Tarefas (filho).

Tanto o Épico, quanto a Tarefa, iniciam o fluxo no Status "Backlog" e possuem o campo "due date". Preciso criar uma automação que vai verificar o maior valor do campo "Due date" das Tarefas e atualizar o campo "Due date" do Épico.

Exemplo: imagine um Épico com 3 Tarefas e, tanto o Épico, quanto as Tarefas, estão no Status "Backlog".

Épico 1 - Tarefa 1

Épico 1 - Tarefa 2

Épico 1 - Tarefa 3

Quando eu movimentar a primeira de alguma das 3 Tarefas do Status "Backlog" para "Em desenvolvimento", a automação deverá:

1) Ler todas as 3 Tarefas do Épico 1 e verificar qual delas tem o maior valor para o campo "Due date"

2) Atualizar o campo "Due date" do Épico com o valor do campo encontrado no item anterior (item 1).

3) Movimentar o Épico para o Status "Em desenvolvimento"

Conseguem me ajudar a montar essa automação?

Obrigado.

2 answers

2 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.
May 2, 2025

Hi @Vinícius Pereira 

This is a fairly common scenario to sum a field (or find the maximum value) for child issues of an Epic.  The key is using the Lookup Issues Action with JQL to gather the child issues and find the maximum due date from there:

{{lookupIssues.duedate.max}}

 

I recommend reviewing the documentation on automation rules, trying to create the rule, and if you run into challenges, post images of your rule and explain what is not working as expected.

To get you started, please see these documentation sources:

 

Kind regards,
Bill

Vinícius Pereira
Contributor
May 5, 2025

Olá Bill, bom dia! Obrigado pelo retorno!

Alterei a automação com os dados que você me passou, mas, não deu certo.

Segue a automação para sua análise:

image.png

 

image.png

 

Passo-a-passo da automação:

- Se eu transaciono de "Backlog" para "Em desenvolvimento" e for uma "Tarefa"

     - Busco o "Pai" (Épico)

     - Se o "Status" do "Pai" não for "Em desenvolvimento" e o campo "Due date" estiver vazio

          - Edito o campo "Due date" do "Pai" fazendo um update com a maior "Due date" que ele encontrou dos "Filhos"

          - Transaciono o "Pai" para o Status "Em desenvolvimento"

 

Porém, não está funcionando! Parece que não está reconhecendo o comando "{{lookupIssues.duedate.max}}"

Consegue me ajudar?

Obrigado.

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.
May 5, 2025

Thank you for the additional information.

Your rule is missing a step to use the Lookup Issues action with JQL.  That must be used before the {{lookupIssues}} smart value may be used in the edit.

For example, inside of the branch that might be this:

  • action: lookup issues, with JQL of
    • parent = {{issue.key}}

 

As needed, please add additional criteria for selecting the issues to the JQL.

Vinícius Pereira
Contributor
May 5, 2025

@Bill Sheboy 

Boa tarde!

Não entendi sua orientação. Poderia, por gentileza, enviar um print como exemplo?

Obrigado.

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.
May 5, 2025

Using your rule as a starting point, I will add a bolded section for the addition:

  • trigger: work item transitioned
  • condition: issue type equals Tarefa
  • branch: to the Parent
    • condition: Status does not equal EM DESENVOLVIMENTO
    • condition: Due Date is empty
    • action: Lookup Issues, with JQL of
      • parent = {{issue.key}}
    • action: Edit Work Item, setting the due date to
      • {{lookupIssues.duedate.max}}
    • action: transition the work item to EM DESENVOLVIMENTO

 

Like # people like this
Vinícius Pereira
Contributor
May 6, 2025

Olá, @Bill Sheboy , bom dia!

Muito obrigado! Funcionou, perfeitamente!

Like # people like this
0 votes
Answer accepted
John Funk
Community Champion
May 2, 2025

Olá Vinicius,

Pode utilizar o seguinte código numa automação para obter a data máxima. Geralmente, é melhor utilizar a funcionalidade lookupIssues para obter todos os problemas ou apenas utilizar o problema de disparo com uma ramificação para os Filhos. Em seguida, no ramo pode selecionar a data máxima ou mínima.

{{issue.subtasks.Due date.max}}

https://community.atlassian.com/forums/Jira-questions/Create-an-automation-rule-for-due-date-and-start-date/qaq-p/1519532

 

Vinícius Pereira
Contributor
May 6, 2025

Bom dia @John Funk !

Obrigado pelas orientações.

 

Like John Funk 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