Compare between fields in different issues

ירדן_חי March 6, 2020

Hi,
I want to create a duplication rule, that compare between some fields in different issues.

If the issuetype, the Organization, the hostname, and the sha-256 fields are similar in the different issues, I want to link them into the first issue and close them as duplicate.

I'm using "Automation for Jira" plugin, but I cant configure the rule well. I use the field ID and I want to compare between the current issue to the previous issue, but without success.

As you can see in picture, I set that if issue created and his issuetype is "SEP", and if his organization equals to another organization (10002), and if his hostname equals to another hostname (10052), and if his sha-256 equals to another sha-256 field (10077), then the issue closed as duplicate. I dont receive errors since, but the action wont done.

SEP Automation.png

SEP Automation logs.png

I can assume that I configure something wrong, but I don't know how to compare the created issue to the one that created before.

I'm adding picture that shows the ticket that created, and they created with the same values in fields, they are exactly the same! 

Duplication.png

Maybe someone have the same problem and know how to solve this!

 

Regards,

Yarden

1 answer

0 votes
Earl McCutcheon
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
March 11, 2020

Hello @ירדן_חי ,

To close out an issue as a Duplicate and link it back to the original using an automation rule, what I find works really well is a two part solution, and the example below is the most basic form you could do with this but you can get more elaborate if needed.

First create a rule on issue create to identify the Duplicate via a Branch Rule JQL search against the custom field smart value you are using as the unique identifier and set the action to Link the issue as a duplicate, like this the following example, noting that in the example this should have the custom field set as a required field on create to make sure the automation cannot be bypassed, otherwise you may need to do additional rules or if then rules for any action that could update the field through the workflow:

Screen Shot 2020-03-11 at 2.26.38 PM.pngScreen Shot 2020-03-11 at 2.30.06 PM.png

Additional details On JQL Searching and Automation Smart Values can be seen in:

Next Create an additional Rule that will be triggered when an issue is linked as a duplicate and trigger the issue to be transitioned to done, this way if the field when set on issue creation, contains the incorrect value and you later identify the issue as a duplicate OR the issue is manually Linked as a duplicate later on even though the custom field value is different, either action will trigger the Auto Close function of the duplicate, I also Like to add in a comment to say "Closed as a duplicate of {{destinationIssue.key}}." like the following, to have additional visibility in the actions completed:

Screen Shot 2020-03-11 at 2.46.42 PM.pngScreen Shot 2020-03-11 at 2.46.48 PM.pngScreen Shot 2020-03-11 at 2.46.59 PM.png

Using this set up any issue created where the custom field value matches the value of a preexisting issue it will be linked as a duplicate then closed out, adding a comment as to why the issue was closed.

Regards,
Earl

ירדן_חי March 12, 2020

Thank you for answering.

The solution you suggested stands for some of our requirements. The first part compare text field to custom fields. I try to  compare between two issues automatically. It means that if ticket created, the rule will compare some specific fields to the same fields of previous issue that created. So, if two tickets created and the fields are the same, the status will change to closed and the resolution to duplicate (the second rule fit the requirement).

Suggest an answer

Log in or Sign up to answer