How can I check if a list of fix versions is included in the list of all versions in a project
Asked by Thomas:

We use an automation to move issues from a state "ToBeReleased" to done once the fixVersion of the ticket is released. That so far is all straight forward, now I wanted to extend that functionality for tickets that have multiple fixVersions. They should only be moved if all versions are released.

{{issue.fixVersions.name}} gives me the list from the issue

{{project.versions}} gives me the list from all project versions

If I check for a single version like this {{#project.versions}} {{#if(equals(name,"\*\*\*\* 1.2.6"))}}{{name}}{{\^last}},{{/}}{{/}}{{/}} I get the one value shown if it is included.

I thought now I can just do a For Each Branch on {{issue.fixVersions.name}} and compare the names one by one but I dont know how to access the single version names there to check if they are included.

Can anyone point me in the correct direction, maybe also there is an easier way to achieve what I want? Thanks in advance


Answers:
author: Rudy Holtkamp
body: Hi [@Thomas](/t5/user/viewprofilepage/user-id/2691022) ,

If I understand it right, you want to transition an issue when all versions mentioned in an issue have been released.

I don't think you need to use the project smart value. What you can do is:

**Trigger:**

Version is released

**Bran rule JQL:**

JQL: fixVersion in ({{version.name}})

Disable checkbox 'Only include issues that have changed since the last time this rule executed'

**Within the branch:**

**create a variable component with:**

Variable name: releaseOfIssuePossible  
Smart value: {{issue.fixVersions.released}}  

**Next a advanced compare condition:**

First value: {{releaseOfIssuePossible.match(".\*(false).\*")}}  
Condition: equals  
Second value: empty

**Next a transition component:**

Transition to 'Release' (or whatever the next status is called)

This should transition all issues where all fixversions are released. All other issues will not be transitioned. I personally would opt for adding a comment that version X has been released which contains the issue.

I hope this helps.

comments: author: Thomas
body: Thanks a lot, I will try it later


author: Bill Sheboy
body: Hi [@Rudy Holtkamp](/t5/user/viewprofilepage/user-id/636802)

Won't that match() function in the advanced compare only find "false", or unreleased states...and then try to compare that to "true"?

What if instead the advanced compare did this:

* first value: {{releaseOfIssuePossible.split(", ").distinct}}
* condition: equals
* second value: true

The first value splits any release states into a list, returns one distinct value for each possible one, and then only proceeds if one-and-only-one "true" was returned.

Kind regards,  
Bill


author: Rudy Holtkamp
body: Hi, I see my mistake.

It should be:

First value: {{releaseOfIssuePossible.match(".\*(false).\*")}}

Condition: equals empty

Which translates to: when there are no unreleased versions which are mentioned in the issue.


author: Thomas
body: Hi, I now implemented it like described but there seems to be an issue with the JQL:

<br />

Error searching for related issues. This is most likely because the following issues don't have a related issue of the type you specified. Try narrowing your search to only include issues that contain links to related issues:  
NO ISSUE: "(fixedversion in (AutomationTest0.0.1)) AND (project in (10038))" - Field 'fixedversion' does not exist or you do not have permission to view it.  
I tried with different values like "version", "fixVersion", fixedVersion" but always the same error.

![Screenshot 2023-11-16 at 19.59.36.png](https://community.atlassian.com/t5/image/serverpage/image-id/292275iA6189727127A7FD3/image-size/large?v=v2&px=999 "Screenshot 2023-11-16 at 19.59.36.png")


author: Rudy Holtkamp
body: Should be fixVersion

Does it work in the UI?

Is the version released part of the project (10038)?

If not you need to change the automation rule scope


author: Thomas
body: I would like to reply faster but this page always gives me weird error messages:

You may have recently posted the same thing elsewhere on the community. Update your text, or wait before reposting.

With fixVersion it's working, exactly that variant I did not try...

Thanks a lot:

![Screenshot 2023-11-16 at 20.42.56.png](https://community.atlassian.com/t5/image/serverpage/image-id/292290iEFDAB2B1640C4899/image-size/large?v=v2&px=999 "Screenshot 2023-11-16 at 20.42.56.png")