Hi
We have a project where versions are named based on a name scheme that makes them predictable. Like "PROJECT NAME 0.0.1"
I would like to create a rule that edits an issue and assigns a specific version based on a regular expression.
Is it possbile to use a regular expression in the fixVersion field to choose a specific version based on its name?
Please see attached screenshot, where I tried to add some "pseudocode" to the fixVersions field to give an idea of how I envision the regular expression to be used.
Thank you in advance for your help!
In ended up using a big workaround. In case another person finds this thread I will describe the gist of the workaround here:
Since I never release something which has no issues. I decided to use the lookup action in the Jira automation. That way I can lookup and find issues with the version. And since JQL fixVersion supports wildcards I can do what I want.
The lookup I make looks like this: `fixVersion ~ "MY VERSION PREFIX*"`
Then I can access the name of the version from the next action by using: `{{lookupIssues.get(0).fixVersions.get(0).name}}`
And that will contain the name of the release. And I can use that as a name to release that specific release.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I ended up solving this with a work around. It's not a perfect solution but it works. Im describing it here in case anybody stumbles upon the thread in search of a solution to a similar problem.
I realised that I never want to release a version that does not have any tickets. And therefore I could use JQL lookup to find all issues with a specific version name. Since JQL lookup for fixVersion can contain wildcards that will make it possible for me to find the release name.
So in my automation i made this lookup `fixVersion ~ "MY VERSION PREFIX*"`
And from the next step in the automation I can therefore get the name like this:
`{{lookupIssues.get(0).fixVersions.get(0).name}}`. And I can use that name to trigger the release
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Graunephar
Thanks! I thought that the {{project}} smart value was only available with the Project Created trigger.
For your question, I believe you will need to use smart value, list filtering to match on the name and then grab the id value:
{{#project.versions}}{{#if(exists(name.match("(yourRegularExpression)")))}}{{id}}{{/}}{{/}}
If it is possible for multiple matches, you may want to put this into a created variable first and then perform some conditional tests.
Kind regards,
Bill
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Bill Sheboy
Thank you for your help!
Just for clarification (in case anybody stumbles upon this in the future) my example was just something I made up in order to illustrate the problem.
I tried your solution, However it seems that I cannot add your expression to the field. It keeps deleting the content, and there are no way of saving. Seems like the field will only accept concrete names of versions.
Do you have any idea if there is something else I can do to use the regular expression?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
To use a smart value expression like that in an edit, please try:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Bill Sheboy
Sorry for the late reply.
I tried you solution a couple of times now, and when I copy it into the field in Jira the dropdown just say "No options" and there is nothing I can choose. (see screenshot below)
I tried putting the regex in as many formats as I could think of. But I just cannot seem to find the format that the dropdown will accept.
Can you point me in the right direction?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.