Olá Comunidade,
Estou configurando uma automação para processamento em lote de múltiplos itens e salvando um resumo formatado de volta no ticket que iniciou a regra. No entanto, o valor final não está sendo salvo corretamente no ticket acionador (ou está vindo vazio/parcial).
1. O Fluxo da Minha Automação:
Gatilho: Formulário enviado (JSM).
Busca/Ramificação: Use um bloco Branch issue(Para Cada) com JQL para encontrar ingressos múltiplos ( key IN ({{triggerIssue.customfield_chave_lista}})).
Objetivo do Loop: Para cada ticket encontrado, eu transito o ticket e, ao mesmo tempo, acumulo ou keyeo Serial Numberem uma lista única.
Ação de Acúmulo: Use a ação Edit issuecom o destino proposto para The trigger issueconstruir a lista, usando a sintaxe de concatenação:
Campo Destino (Ex: customfield_11729): {{triggerIssue.customfield_11729}} {{issue.key}} - SN: {{issue.customfield_SN_ID}}\n2. O Problema:
O campo customfield_11729do acionador de tickets não contém a lista completa de todos os tickets processados.
Se eu usar Set variableno loop: O valor está perdido fora do escopo do branch.
Se eu usar Edit issueno triggerIssue: O campo final no ticket acionador é, ou parcial (mostra apenas o último item do loop) ou fica vazio .
Parece que o campo {{triggerIssue.customfield_11729}}não está sendo lido corretamente nas iterações subsequentes para acumular o valor.
3. Minhas Perguntas:
Qual é a melhor prática oficial para acumular (concatenar) valores de ingressos múltiplos ( {{issue}}) em um único campo {{triggerIssue}}dentro de um loop de Branch issue?
Existe alguma restrição de tempo que requer a ação Waitentre a leitura e a escrita do mesmo campo ( customfield_11729) no ticket acionador durante o loop?
qualquer orientação sobre a sintaxe correta ou você deve usar o componente Create variablecom escopo global se estiver disponível.
Hi @Eric Silva
When a rule branches over more than one thing, it processes in parallel and asynchronously, with no guarantee when the branch will complete, up until the last step of the rule.
This means anything which happens inside the branch cannot be accessed afterwards, such as an accumulated, created variable. And, if there are attempts to edit the same work item repeatedly inside the branch, it could fail or even collide with earlier writes.
Depending about the specifics of the scenario, one workaround is to use the Lookup Work Items action with JQL to gather and accumulate the data, and then perform one single edit with the content from the lookup.
Kind regards,
Bill
Tinha postado algo mas a solução do Matteo é a melhor.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Eric Silva ,
Thank you for your post. I sugget to try to declare a variable before the branch and then assign values to that variables.
At the end, assign the variable value to field.
I hope it helps
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.