Identify Duplicate in Status and transition
Asked by Christina Evans:

I am having a difficult time figuring out how to get automation to recognize an issue with a duplicate summary, link it, and transition the duplicate.

I have an automation set on a different board (Board A) to generate an issue another board (Board B.) There are times people move issues back and forth through the workflow on Board A causing board B to have duplicates.

On Board B I would like to set an automation in "To DO" status that recognizes the summary lines are the same, links the issues, and transitions one to a Done status.

Any thoughts?![Screenshot 2024-06-27 103607.png](/t5/image/serverpage/image-id/332150i474DA69727A45316/image-size/large?v=v2&px=999 "Screenshot 2024-06-27 103607.png")


Answers:
author: Tommaso Gionfriddo _Teklada_
body: Hi [@Christina Evans](/t5/user/viewprofilepage/user-id/5174965) ,

Current approach {#toc-hId--354175895}
--------------------------------------

There are quite a few small issues with your current approach, which is why it's not working.

#### Scheduled trigger {#toc-hId--1460565780}

Assuming your scheduled trigger is set to run a JQL search, I think you have a slight misunderstanding of how to access the issues returned by the search.

When you run a JQL query as part of a scheduled trigger, all the actions within the automation rule will run for each issue, as if the automation had been triggered for an individual issue. This means you do not need to use any branches.

#### Lookup issues {#toc-hId-1026947053}

I can also see that you have referred to **both** {{lookupIssues}} AND {{issue}}. {{lookupIssues}} is only set when you use the Lookup issues action. Did you mean to add a Lookup issues action before the branch?

#### Most recently created issue {#toc-hId--780507410}

The most recently created issue can only be accessed when you have created an issue during the execution of the automation rule. In your current case, the most recently created issue will always be empty.

#### Logic/Trigger {#toc-hId-1707005423}

Your current approach is based on checking periodically checking for duplicates. While there's no reason this can't work, it might make more sense to instead for duplicates each time a new issue is created. This would allow you to simplify the logic a little bit

Suggestion {#toc-hId--801513618}
--------------------------------

Overall however, I think you a solving a problem which doesn't need to exist.

Instead of closing these duplicate issues, why not add logic to your existing automation to ensure duplicates are not created? Before creating the issue in board B, check whether another issue in board B already has the same summary, or better yet check whether the issue in board A has already been duplicated to board B, perhaps via an issue link.

I'd be happy to provide some further detail on the specifics of the configuration, but would recommend first that you give the above another try. If you get stuck, please provide a screenshot of the issue cloning automation.


author: Trudy Claspill
body: Hello [@Christina Evans](/t5/user/viewprofilepage/user-id/5174965)

What are the details of your Scheduled trigger? Are you running a JQL to select issues in that trigger?

Next, there are numerous problems in your rule. Your first problem is that your Branch step is not valid.

The {{lookupIssues}} smart value is populated by a Lookup Issues action. Since you don't have a Lookup Issue action, your smart value has no data.

Another problem is your step to link to most recently created issue. "Most recently created issue" is a reference to an issue created within the same automation rule, but this rule is not creating any issues.

You might want to consider going back to the automation rule that is creating the duplicate issues and modifying it so that it won't create the duplicates, eliminating the need for this second rule.. Can you share the details of that rule with us?

comments: author: Christina Evans
body: That is a good point. I need to prevent duplication because users sometimes pull the issue backward in the workflow, then retrigger the issue creation. This is the flow I have to create the issue. Any thoughts on blocking duplicates? I do have a unique link set between the issue types.![Screenshot 2024-07-03 095959.png](https://community.atlassian.com/t5/image/serverpage/image-id/333349i6FF716DAB4DCB900/image-size/large?v=v2&px=999 "Screenshot 2024-07-03 095959.png")


author: Tommaso Gionfriddo _Teklada_
body: This looks good [@Christina Evans](/t5/user/viewprofilepage/user-id/5174965) ,

Next, before you create the issue, add a Related issue condition.

Configure as follows to achieve your desired result (although there are other possible ways to do it). Make sure to select the specific link type you are using.

If you encounter problems, try flipping the link direction in the condition. Links are directional, Is blocked by -\> Blocks.

![Screenshot 2024-07-03 at 18.19.22.png](https://community.atlassian.com/t5/image/serverpage/image-id/333356i68E07500813916B5/image-size/large?v=v2&px=999 "Screenshot 2024-07-03 at 18.19.22.png")


author: Christina Evans
body: Thank you a bunch!


Tags: cloud

jira-cloud