Automation rule to link issue to an item in a different project when a fix version has been added
Asked by Gile Empey:

We are using cloud and I am working on building out a release management project. Ideally what happens is that when a fix version gets created in our software project (where teams are sprinting and writing code), a release ticket will get created to track this work for releasing to production.   

I have automation working to create this new ticket, but what I can't figure out is how to link an item to this same release ticket when that same fix version gets added on the software project.   

Not sure if this is possible, but I am open to other solutions or recommendations as well.


Answers:
author: Bill Sheboy
body: Hi [@Gile Empey](/t5/user/viewprofilepage/user-id/4889649)

Rules with a single-project scope may create (or clone) issues into other projects, but not otherwise access or update them.

When a rule needs access to issues in multiple projects, it needs to be multiple-project or global in scope. To enable this, your Jira Site Admin will need to configure the rule in the global automation area.

With scoping handled, I recommend mapping out which events happen to trigger the different things...and then identify the rules needed. I suspect you need at least two rules:

* your existing rule: triggered on Version Created in the software project, which then creates a "release ticket" issue in the release management project
* another rule, with multiple-project scope, where...
  * triggered on a change to Fix Version *when a value is added*
  * use Lookup Issues with JQL to identify the "release ticket" in the other project
  * use that information to link the issues

Please note well: this is the "happy path". If you want to also handle removal of Fix Versions from software project issues, or manual tampering with the links in the issues, additional rules will be needed, and likely be brittle. (They could be brittle because there is an open defect that if the Fix Version field is changed too much, the changelog becomes inaccurate: <https://jira.atlassian.com/browse/JRACLOUD-80486>)

Kind regards,  
Bill

comments: author: Gile Empey
body: Thanks for your reply [@Bill Sheboy](/t5/user/viewprofilepage/user-id/1685313)  

I am a site admin and already have the first rule and configuration set up to create a "release" ticket, but I am not following the other rule you mention fully. My options are limited when using the trigger for the value changing on a given ticket. There's no way to link it to that release ticket.  

![Screenshot 2024-07-22 090224.png](https://community.atlassian.com/t5/image/serverpage/image-id/337069i5FB98E889EA69F99/image-size/large?v=v2&px=999 "Screenshot 2024-07-22 090224.png")  

I believe you are recommending adding an IF after the trigger for some JQL, but how am I going to match these together via JQL? I can't see a way to write this query that will give me what is needed in order to link the item to the newly created "release ticket" in the first rule. Any help here would be great.  

Thanks.


author: Bill Sheboy
body: Using the changelog / fieldChange smart values to detect the added fix version value, you may then create a JQL statement to find the release management issue in the other project. Use that JQL with the Lookup Issues action to get the release management issue's key. Then use that issue key to create a JSON statement to link to the trigger issue.

Here are the references you need for the parts of that:

* <https://support.atlassian.com/cloud-automation/docs/jira-smart-values-issues/#--fieldChange-->
* <https://support.atlassian.com/cloud-automation/docs/jira-automation-actions/#Lookup-issues>
* <https://support.atlassian.com/cloud-automation/docs/advanced-field-editing-using-json/#Linking-issues>


Tags: jira-cloud

release-management