JIRA automation newbie, struggling with an issue. We have releases which go from QA to Staging to Production. We create the releases a couple months in advance. When a ticket goes from Deployed to DEV to Ready to Deploy to QA state, I would like to automatically assign it to the next unreleased fix version which contains the name "qa". I can't use the "next unreleased fix version" option because I need to ensure it is the next QA fix version. I have attempted viewing multiple questions/answers in the community but I am still unable to get what I need. I am currently trying to simply create a variable that would have the unreleased fix versions for the project, but it doesn't seem to populate. I am attaching prints of the rule and the variable definition.

The versionList variable has the following code snippet to populate it. The Audit Log step shows nothing when attempting to display the contents of the verionsList variable. Any help would be appreciated.
{{#issue.project.versions}}
{{#not(archived)}}
{{#not(released)}}
{{#name.matches("qa")}}
{{name}},
{{/}}
{{/}}
{{/}}
{{/}}