Looking for two fields that are the same
Asked by Melanie.Johnson:

We are trying to create an automation where the system would look for a field that duplicates. To help a little we created a custom field JIRA field for Dev Ops,. We are trying to automate and would be looking for that field to match from other tickets, from there we would finish our automation. Our problem is that we are having an issue with figuring out this automation. Anyone dealt with this before?


Answers:
author: Mikael Sandberg
body: Hi [@Melanie.Johnson](/t5/user/viewprofilepage/user-id/5429759)

Welcome to Atlassian Community!

So if I understand this correctly you want to find existing requests that have the same value as a new one in a specific field? If so then you can do something similar to this automation:

![Screenshot 2024-02-22 at 2.33.11?PM.png](https://community.atlassian.com/t5/image/serverpage/image-id/308226i179306B2E8F49CBD/image-dimensions/247x293?v=v2 "Screenshot 2024-02-22 at 2.33.11?PM.png")

In this example the automation is looking for duplicate requests that have the same Prisma Id in the description, and then link the requests as duplicate and closes the new one (not included in the screenshot).

If your custom field is a text field then you can use "\\"something\\"" to do a distinct search in that word/phrase.

comments: author: Melanie.Johnson
body: Thank you we will try this. Appreciate the input we are new to this :)


author: Melanie.Johnson
body: We were successful with linking the issues to our custom key, closing the original issue but are having issues with the child transitioning to approved. This is the message we received. Have you seen this issue and if so do you know where we go and look to fix this? ![Capture.JPG](https://community.atlassian.com/t5/image/serverpage/image-id/309321i9D8D126BABB44880/image-size/large?v=v2&px=999 "Capture.JPG")


author: Mikael Sandberg
body: Are you running the rule as Automation for Jira or another user? Check that you can transition from the current status to Approved.


author: Melanie.Johnson
body: We are running the rule with automation for Jira. We are able to close the original issue which is part of the merge through automation. We also have added Automation for Jira as an approver on the issue which we need to be approved.

When I go into the ticket it tells me that i do not have permission to transition this issue. This issue is coming from our Dev Ops and not from the original JIRA system.


author: Mikael Sandberg
body: Okay, so check if there is a transition in the workflow that will take you to the Approved status from the initial one. If you do not have a global transition to Approved that would explain the error. You would then have to either follow the workflow or add a global transition. The global transition can be hidden by adding a condition on it so it is only available for automation.


author: Melanie.Johnson
body: Thank you! We got that to work we needed to not use transition but tell the system to approve or decline. One last issue we encountered. The two issues are linked and currently one is closed (the original issue) and the second linked issue is the one that we want approved. With the automation to close the original issue we discovered that right after the second issue was linked and approved it closed. How do we tell the system that we want the child or parent only to close? You have been a huge help to us and I want to thank you!


author: Mikael Sandberg
body: I would start by looking at the workflow and the status that has the approval process on it. Is the approved transition going directly to the closed status? Without knowing what the workflow looks like it is just an educated guess.


author: Melanie.Johnson
body: Yes the workflow is set that it can go from approved to closed. Is there a way that we can add in the automation that we want the parent to go to closed and the child remain approved? I tried searching in the community and do not see anyone that has asked this.


Tags: cloud

jira-service-management

jira-service-management-cloud