Forums

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

Create ticket automation

Felipe Rodrigo Pinto Pereira de Lima October 25, 2022

Great afternoon everyone.

I recently started working with Jira, and I haven't found any topic with exactly what I should do, to create an automation that creates tickets on the days I select, but doesn't create a ticket that already exists.
For example: I want to create a ticket every day at 06:00 AM with the custom field "Y" that contains the value "X", but if already have a ticket with the value "X" of the same custom field, then not create this ticket. Is it possible with a free license?
Here's a print of how I tried to do the automation, but it's not working.

If there is already an answer for this, I apologize for not finding it, I'm still new to the Jira communityAutomation.png

2 answers

1 accepted

1 vote
Answer accepted
Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
October 25, 2022

Hello @Felipe Rodrigo Pinto Pereira de Lima 

Welcome to the community.

When you say an automation rule is not working, there is some additional information that we need to help you. Specifically, what do you mean by "not working"?

Is the rule not getting triggered?

If it is getting triggered, what does the Audit Log say? Notice "Audit Log" in the upper left corner below "Automation", your rule name, and "Rule Details"? Click on that to see the audit logs for each configuration change for the rule and each execution of the rule.

Can you show us the details of the Trigger? A Schedule Trigger can be set up to use a JQL or not use a JQL.

The component that follows is a Condition. That condition requires an issue to operate against. If you Schedule Trigger didn't include a JQL for selecting issues, then you Condition doesn't have an issue to operate against.

Regarding your condition:

" if already have a ticket with the value "X" of the same custom field,"

Are there any other things that need to be true about that issue, like the day it was created or its current status?

Felipe Rodrigo Pinto Pereira de Lima October 25, 2022

Sorry not to specify. It's not trigging. It just doesn't open the ticket. But then what I wish to do is possible?

But yes, I had forgotten the JQL part, and I sure wrote it wrong, but I don't know what to specify in the JQL according to the prints. Can you guide me exactly what I should write? See if these prints help you, please.

If anything is missing, I apologize, just ask and I'll look for it and put it here. Thank you so far for your help.

3.png4.png5.png1.png2.png

Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
October 25, 2022

Hello @Felipe Rodrigo Pinto Pereira de Lima 

The error is explained in the Audit Log. The JQL statement you have in your Schedule Trigger is invalid.

Screen Shot 2022-10-25 at 1.37.55 PM.png

 

However, I would recommend a different way to accomplish this with Automation.

When you set up a Schedule trigger with a JQL statement, that is usually done because you want to execute some operation for all the issues that are found by that JQL statement.

Instead I would recommend that you use the Schedule trigger without a JQL statement.

For the next component I would recommend the Lookup Issues action. You can use a JQL statement to search for issues. 

Screen Shot 2022-10-25 at 1.43.40 PM.png

After the LookupIssues action I would add a Condition: Advanced Compare and check how many issues were returned by the Lookup Issues action. The value you want is the one that will indicate you DO want to proceed with creating a new issue. I would construct the JQL so that you would want it to return 0 issues.

Screen Shot 2022-10-25 at 1.46.20 PM.png

And then add the Action to Create Issue.

Like # people like this
Felipe Rodrigo Pinto Pereira de Lima October 26, 2022

Thank you very much for your help so far, but I still haven't been able to make the automation not open a ticket when already have a ticket with that name.

Now it's opening the ticket, it's not showing any error in the log, but the tickets are repeating, even though they already have one open.

To tell you the truth, I still don't understand what Lookup is doing.Can you give me more details, to understand what I'm doing wrong, please?

Here are some prints:6.png7.png8.png9.png10.png11.png

Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
October 26, 2022

Does the JQL in your Lookup Issues action represent the criteria you want to apply to figure out if an issue already exists? In my example I used "Status" in my criteria. In you latest images I see that you also used "Status", but in your original images you were using "PSA". You need to set the Lookup Issues JQL to use the correct criteria for your situation. If you want to only make an issue when there are no issues where

"PSA" equals <some value>

then the JQL in you Lookup Issues action needs to reflect that; i.e.

PSA = <some value>

If there are any issues where PSA equals <some value> then the size of the lookupIssues results will be greater than zero, and your rule will terminate on the condition where you are checking that size value.

Felipe Rodrigo Pinto Pereira de Lima October 26, 2022

Hmmm I understood a little better how this Lookup works, but now it's not generating the Ticket at the time I put it to automatically generate, at the time I stipulate.
I put the value of "PSA" with what I want in this case is: "PSA_Pós_Akta_Saint_Tropez_Santos_B", I put it to generate the ticket with 2 minutes left, but when the time came, it didn't generate. Did i do wrong?

I'm sending only one image, because I didn't change anything else, compared to the other images12.png

Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
October 26, 2022

When you run a Scheduled rule to create new issues, the new issues will be created immediately when the rule is scheduled to run.

If the new issue was not created, review the Audit Log for the Rule to see if there was an error logged or if a condition was not met. Share that log with us.

I don't understand what you mean by you "put it to generate the ticket with 2 minutes left". Please provide more details about that.

Felipe Rodrigo Pinto Pereira de Lima October 27, 2022

Sorry if I expressed myself badly, my English isn't that good. When I referred to missing 2 minutes, it is due to the time I put to activate the rule to run. As for the logs, there were no errors.2 min.png13.png

Felipe Rodrigo Pinto Pereira de Lima October 27, 2022

Sorry, missing a print.14.png

Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
October 27, 2022

Hello @Felipe Rodrigo Pinto Pereira de Lima 

The audit log says that the Lookup Issues action did not find any issues where 

PSA="PSA_...."

You condition says if no issues are found then create the issue.

The log indicates the new issues was created. The issue key for the new issue is TI-10.

The log shows a time stamp of 9:09 am. That matches the time you set in the Schedule Trigger.

I don't see any failure in this process. Can you point out what you think is not working?

If it is easier for you, provide your response in your native language and we will translate it to our own languages to review it.

Felipe Rodrigo Pinto Pereira de Lima October 28, 2022

Certo, acredito que o problema seja que não tem uma regra para especificar que deva abrir tickets quando o ticket anterior esteja no status "Resolvido", pois daí não estava abrindo o ticket, até chega a abrir se eu excluir o ticket, mas quero que eles fiquem salvos no Status "Resolvido". 

Tentei colocar a regra "PSA="PSA_Pós_Akta_Saint_Tropez_Santos_B" and status != "Resolvido"" no Lookup Issue. Mas não está abrindo o Ticket na hora que estipulo, só abre caso eu clique em "Run Rule". Não sei se usei o termo correto, tentei outros termos, mas estavam dando erro no log. Esse não dá erro, abre quando eu clico em Run Rule, mas não abre o Ticket automaticamente no horário que especifiquei.

Sabe me informar o que estou fazendo de errado? Pois minha ideia com o Jira é de criar vários tickets automaticamente (cerca de uns 700 aproximadamente) no horário e nos dias que eu especificar, e irmos fechando eles todos os dias, mas aqueles que não fecharmos (colocar no status "Resolvido"), não quero que abram novamente no dia seguinte.  Pois hoje em dia usamos uma planilha e vamos marcando os pontos que estão online, e resolvemos os que estão offline. Mas quero automatizar tudo isso pelo Jira para ficar mais organizado, saber quanto tempo estamos demorando, entre outros relatórios que o Jira pode nos fornecer. Conseguiu entender melhor minha idéia?

Seguem os prints:Fluxograma.pngregra.pngRun rule.png

Felipe Rodrigo Pinto Pereira de Lima October 28, 2022

If you want I can write again in English.

Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
October 28, 2022

Olá @Felipe Rodrigo Pinto Pereira de Lima ,

Acho que entendi seu caso de uso. Obrigado pela explicação adicional.

Seus problemas de pesquisa JQL está definido para procurar quaisquer problemas em que "PSA" esteja definido para o valor especificado e em que "Status" seja NÃO IGUAL (!=) a Resolvido. Ele retornará uma lista vazia somente se os problemas do dia anterior estiverem definidos como Resolvidos.

Você só deseja que um novo problema seja resolvido quando os problemas do dia anterior forem Resolvidos.

No exemplo que você mostrou, o JQL encontrou um problema com o valor de PSA e em um Status que não é Resolvido. Essa é a questão TI-12. A ação Lookup Issues retornou uma lista com 1 problema.
A condição diz que a lista precisa estar vazia para prosseguir com a criação de um novo ticket. A lista não está vazia, portanto, nenhum novo ticket foi criado.

Parece-me que a regra está funcionando corretamente. A entrada de log diz que nenhuma ação foi tomada. Essa é a conclusão adequada. Sua ação Pesquisar problemas encontrou um problema que não foi resolvido, portanto, não executou a ação de criar outro novo problema.

Observando as informações do log de auditoria, vejo que logo abaixo da entrada de log que você expandiu há outra entrada de log com um status de sucesso e um carimbo de hora de 8h50. Isso corresponde ao horário que você definiu em seu gatilho de agendamento. Isso me diz que a regra foi executada no horário agendado e foi executada com êxito.

Se você expandir essa entrada do Log de auditoria, suspeito que ela pareça idêntica à que você mostrou às 8h51.

Felipe Rodrigo Pinto Pereira de Lima November 1, 2022

Ótimo dia.

 

Acredito que agora está funcionando corretamente. Muito obrigado pela ajuda.

0 votes
Felipe Rodrigo Pinto Pereira de Lima October 25, 2022

Sorry, I almost forgot to post the image.

Automation.png

Suggest an answer

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

Atlassian Community Events