Are you in the loop? Keep up with the latest by making sure you're subscribed to Community Announcements. Just click Watch and select Articles.

×
Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Jira Automation - Look for duplicates before creating an issue.

Hey all, 

I have a trigger to create an issue. 

The trigger is when a field value is changed to "X", an issue (System Change) is created in the same project. 

However, I would like to check for duplicate issues already created with the same "Summary" and issue type prior to creating the issue. 

If the issue type with a matching Summary already exists, do not create a new issue. 
Instead, link the triggering issue to the existing issue (System Change)

Thanks in advance.

3 answers

2 accepted

2 votes
Answer accepted
Fernando Eugênio da Silva
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Jan 18, 2023

@Justin Gan , Welcome to the Atlassian Community!

 

I think you can use an automation rule like this:

Screenshot_94.png

Rule details:

- The variable resume was created with the smartvalue {{issue.summary}} from triggerIssue so that you can use this value in lookupIssues

- The JQL inside lookupIssues is just an example. You should switch and issuetypes for your use case. I referenced the word 'Atlassian' just as you will use 'Requires Tuning' in your case.

- {{lookupissue.size}} equals 0 > The lookup doesn't found any issue with the "triggerSummary Atlassian" then will create the issue with this value in the summary field

- {{lookupissues.size}} does not equal 0 > The lookup found issues with the "triggerSummary Atlassian" and will associated all this issues founded with the triggerIssue

Ps.: If the triggerSummary has characters like " / - ( the lookup will not work. Need to be a simple summary with words and spaces only.

@Stephen Wright _Elabor8_ , feel free to add any comment to improve this rule. It's always awesome heard your comments

I can see the logic here is similar as well and I would have gotten to the intended result with this. Thanks heaps!

1 vote
Answer accepted
Stephen Wright _Elabor8_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Jan 18, 2023

Hi @Justin Gan 

Just to confirm, the logic is...

  • Field is changed to "Something"
  • This triggers creation of a new Issues
  • If an Issue with the same Summary/Issue Type exists, link it to the trigger Issue
  • If not, create a new Issue, and link it to the trigger Issue

---

Can we clarify...

  • What type of field/value is the Trigger?
  • What determines the Summary? How is this generated pre-creation so it can be searched for?

Ste

Hey Stephen, 

Yes, the logic is correct. 

Can we clarify...

  • What type of field/value is the Trigger?
    The field is a custom field called "Incident Outcome" and the value of the trigger is "Requires Tuning".
  • What determines the Summary? How is this generated pre-creation so it can be searched for?
    The Summary of the new Issue is generated based off the triggering Issue using smart values.
    "{{triggerIssue.summary}} Requires Tuning" is the generated Summary structure for the new Issue.
Stephen Wright _Elabor8_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Jan 18, 2023

Hi @Justin Gan 

Great, see my recommendation below!

  • Trigger: Field Value Changed
    • Field = Incident Outcome
    • Change Value = Value Added
  • Condition: Issue Fields Condition
    • Field = Incident Outcome
    • Condition = equals
    • Value = Requires Tuning
  • Action: Lookup Issues
    • JQL =
      • issuetype = {{triggerissue.issue type}} AND summary ~ "\"{{triggerissue.summary}} {{triggerissue.Incident Outcome}}\""
  • Action: Re-fetch Issue Data
  • Condition: If/Else Block
    • IF...
      • Sub-Condition: Advanced Compare Condition
        • First Value = {{lookupIssues.size}}
        • Condition = equals
        • Second Value = 0
      • Sub-Action: Create Issue
        • Project = Same Project
        • Issue Type = Same Issue Type
        • Fields...
          • Summary = {{triggerissue.summary}} {{triggerissue.Incident Outcome}}
          • ...etc
    • ELSE-IF...
      • Sub-Condition: Advanced Compare Condition
        • First Value = {{lookupIssues.size}}
        • Condition = does not equal
        • Second Value = 0
      • Sub-Action: Link Issues
        • Link Type = <link type here>
        • Value = {{lookupIssues.key}}

---

A few notes on this rule...

  • I've made some assumptions for the Trigger and first Condition, you can change these are required (or remove the Condition, if "Requires Tuning" was just an example value).
  • The Lookup Issues uses "\" to ensure exact phrases are checked in JQL.
  • The Re-fetch Issue Data Action can help slow down a rule - to ensure the Lookup Action takes place first.
  • There's a range of smart values used in this rule - to see more about how these work, see this help page
  • Technically, the last Sub-Action will activate even if the 2+ Issues are already linked. You could stop that if required, by adding an additional Sub-Condition (Relates Issued Condition) and checking what Linked Issues are present.

---

Let us know what you think!

Ste

I made some minor tweaks but the logic you've provided is sound!

Absolute rockstar with the documentation and explanation. Thanks!

Test.png

Stephen Wright _Elabor8_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Jan 19, 2023

Awesome! Glad you found a rule that works for your scenario :)

Ste

Hi to all discussion member!

I'm trying to set up the same, but a much simplier option. I want to link duplicated issues once the ticket is created. I set up the rule like this below, but it seems like the rule finds similar issues, but doesn't link them (I've tried comment issue instesd of linking). What do I do wrong in this scheme?

(I use Jira Software project for this).

2023-09-28_13-39-32.png

Fernando Eugênio da Silva
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Sep 28, 2023

@Dolores Rhyme 

In Trigger Issue action instead use Link to Trigger Issue try to use the smartvalue: {{lookupIssues.key}}

This smartvalue is responsible for displaying the issues that were identified in your lookup query. Then he must associate the identified issues with his current issue

Hi @Fernando Eugênio da Silva ,

The thing is that there;ro no other options insead of these two unfortunately....2023-09-29_11-36-24.png

That's why I'm struggling with this rule. Everything changes so fast in functionality, that tutorials that have been posted doesn't work anymore....

Fernando Eugênio da Silva
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Sep 29, 2023

@Dolores Rhyme 

You need to input manually the smartvalue {{lookupIssues.key}}. When you manually enter the smartvalue, just click on it as shown in the image below and it will be applied in the automation.

 

Captura de tela 2023-09-29 090758.png

Like Dolores Rhyme likes this

Thank you a lot! It wasn't obvious. I really appreciate your advice. It helped me finally!!!!

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events