Forums

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

Automation: Como puedo obtener datos de una incidencia anterior y copiarlos a la nueva

Soporte September 19, 2023

Estoy creando una nueva regla de automatización. He puesto la condición de que sea una nueva, abierta por usuarios mediante ticket y obteniendo el reporter.

Una vez tengo ese reporte, he creado un consultar incidencias y veo que me muestra las anteriores abiertas por él:

automation_1.jpg

Según me dice ahí, se almacena esa lista en {{lookupIssues}} , 

pero cuando incluyo una acción de registro para ver el reporter del elemento 0 (por eso en la consulta puse ASC, para que no me listase primero la incidencia recien creada y que no tiene ese campo) y no me muestra resultados:
automation_2.jpg
He probado a poner fields.Id Cliente , fields['Id Cliente'] y por último con short text ... y nada

Y las otras incidencias si que tienen el campo Id Cliente con información

automation_3.jpg

¿Se os ocurre que puede estar pasando? Sabéis de alguna alternativa para esto? No me creo que nadie haya hecho algo así anteriormente jeje La veo algo muy típico de hacer

Un saludo y gracias por adelantado

2 answers

2 accepted

1 vote
Answer accepted
Trudy Claspill
Community Champion
September 19, 2023

Hola @Soporte ,

Bienvenido a la comunidad Atlassian.

En lugar de usar [0], intente usar ".first" para obtener el primer problema en el conjunto de resultados. Tampoco es necesario incluir ".fields".

{{lookupIssues.first.Id Client}}

Además, para su condición, le recomiendo que utilice la palabra clave "EMPTY".

{{lookupIssues.first.Id Client}} is not Empty

 

---

Hello,

Welcome to the Atlassian community.

Instead of using [0] try using ".first" to get the first issue in the results set. You also don't need to include ".fields".

{{lookupIssues.first.Id Client}}

Additionally for your Condition I recommend that you use the "EMPTY" keyword instead.

{{lookupIssues.first.Id Client}} is not EMPTY

 

I am creating a new automation rule. I have set the condition that it be a new one, opened by users through a ticket and obtaining the reporter.

Once I have that report, I have created a query for incidents and I see that it shows me the previous ones opened by it:

According to what it tells me there, that list is stored in {{lookupIssues}} ,

but when I include a registration action to see the reporter of element 0 (that's why I put ASC in the query, so that the newly created incident that does not have that field would not be listed first) and it does not show me results:

I have tried to put fields.Id Client, fields['Id Client'] and finally with short text... and nothing

And the other incidents do have the Customer Id field with information

Does it occur to you what could be happening? Do you know of any alternative for this? I don't believe anyone has done something like this before hehe I see it as something very typical to do

A greeting and Thanks forward

0 votes
Answer accepted
Soporte September 20, 2023

JQL Condition

No further actions were taken, as the JQL condition was not approved due to an error executing JQL:

Invalid JQL: is not Empty

And another question... what if instead of the first, I want to get the second or not get the current incident?

many thanks for everything

Trudy Claspill
Community Champion
September 20, 2023

Instead of using Matches JQL condition use the Advanced Compare condition.

Screenshot 2023-09-20 at 10.23.13 AM.png

 

Where I used "Custom Short Text" replace that with the name of your field.

 

If you want to not select the current incident then change your Lookup Issues JQL to exclude the issue that triggered the rule.

reporter = {{issue.reporter}} and issue != {{issue.key}} order by created desc

 Then the first issue in the result set will be the most recently created issue (by the same reporter) prior to the creation of the issue that triggered the rule. 

Soporte September 21, 2023

Great!

Thx so mach 👌

Suggest an answer

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

Atlassian Community Events