Within our Jira Instance, most issues will link back to an Epic (or a parent).
I want to build automation so that when I create a brand new linked issue (using the Create Linked Issue button on an existing issue), it will take the Parent from the original issue, and set the new issue to have that parent.
As an example, I have a User Story. The QA team finds a bug. So they create a Bug on the User Story, by clicking the "Create Linked Issue" button.
When the Bug is created, I want it to be linked to the same Parent that the User Story is linked to.
I have been playing around with Jira Automation, using ChatGPT and Claude to get there, and I haven't quite gotten it. Browsing through the archives hasn't quite gotten me there either.
Here is one approach I have taken:
* When Issue Created
* If issueLinkType IS NOT EMPTY
* For: Linked Issues (this goes through all of the linked issues, which should just be one when the issue is created)
* * Inside the Linked Issue Branch now...
* * If the Parent Exists
* * Log the issue.parent.key for transparency
* * Set the Issue Field ( Copy Parent From Current Issue).
The problem with this approach is that the issue it is looking at is the Linked Issue (the User Story). I can't figure out how to get back to the newly created bug to set that one.
I tried using a variable, and outside of the branch setting the current issue (the bug), but the variable is empty outside the branch.
