Forums

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

Automation, create condition that validates existing link tasks and does not recreate this task

Jonathan Santos
Community Champion
November 11, 2021

Hi community !!

Create an automation so that when an issue transition to status "a" "b" create a task (in another project) and link it.
But on the condition that if it already exists, do not recreate it.

Believe this:

1- Issue transitions "Approved" to "Development"
2 -If matches related issues "related to" condition None match specified  (JQL)project = Desarrollo AND issuetype = Task
3-Then Create a task in project ...
4-And link to most recently created issues

2021-11-11_14h06_34.png

But when you rerun this automation, it re-creates the task?
What am I failing at?2021-11-11_14h08_06.png

Thanks !!!!

1 answer

0 votes
Bryan Trummer - ReleaseTEAM
Community Champion
November 11, 2021

Hello Jonathan,

Is the ticket that is being transitioned in the scenario also a task?

Jonathan Santos
Community Champion
November 12, 2021

Hi Bryan, yes!

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.
November 12, 2021

Hi @Jonathan Santos 

Yes, and...to what Bryan asked about:

Your JQL in the related issues condition seems to cover a lot possibilities.  Are you certain you only want one Task in that other project?

And...I have not always found the related issues condition reliable, so perhaps try another way to see if that helps.  Replace that condition with

  • action: lookup issues using your same JQL from the condition
  • condition: {{lookupIssues.size|0}} equals 0

Kind regards,
Bill

Jonathan Santos
Community Champion
November 12, 2021

Hi @Bill Sheboy 

I am trying to create a condition so that if there is already a task linked to the Task  that I am transition to, it will not re-create the task.
Try what you tell me but keep creating the tasks

Sorry if it is not understood

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.
November 12, 2021

Thanks for clarifying, and sorry if I caused confusion. 

You do need that related issues condition on a link, and perhaps you have the incorrect link type selected.  Please check your test issues to see what the link type is, from both directions, to see if there is a different value that should be used.

If you still want to try this with just JQL and Lookup Issues, this should return no issues when the condition is met using linkedIssues()

project = Desarrollo AND issuetype = Task AND issue IN linkedIssues( {{triggerIssue.key}} , "relates to")

Jonathan Santos
Community Champion
November 12, 2021

@Bill Sheboy 

Thanks for your support, but i can't find my mistake:


My request is as follows:


When I transition a task from Aprobado to Desarrollo in the "Operaciones" project, you have to create a task in the "Desarrollo" project and a "related to" link, but if this transition is made again by mistake, this task is created again, then It is duplicated, how do I create a condition for it to validate if it doesn't have a task linked to related to?

1-Issue tipe task transition "Aprobado" to "Desarrollo" (Project Operaciones)

2021-11-13_00h56_38.png

2-Create a Task in the project "Desarrollo" and link to trigger issue link "relates to"2021-11-13_00h59_30.png

3- I go back to the status Aprobado 2021-11-13_01h03_27.png

4- I go to the status Desarrollo2021-11-13_01h06_10.png

5-Create the task and its link again, this should not happen since it duplicates the task, what condition do I have to create in automation2021-11-13_01h08_24.png

 

Thanks !!

Jonathan Santos
Community Champion
November 13, 2021

Hi @Bill Sheboy @Bryan Trummer - ReleaseTEAM  

I was able to solve it, I just needed to add the other project where the task is created.
Thank you very much for your help, they guided me in understanding the automation logic.

Greetings2021-11-13_14h42_17.png

Like # people like this
Bryan Trummer - ReleaseTEAM
Community Champion
November 18, 2021

Great! Glad you were able to solve the issue!

Like Jonathan Santos likes this

Suggest an answer

Log in or Sign up to answer