issuefieldmatch - Affects Version/s field

What name to be used for the field "Affects Version/s" in the scrip runner issueFieldMatch function (2nd argument) ?

For the "Fix Version/s" field it works with "fixVersions" : with or without quotes, but case sensitive. Any other name does not work.

For the "Afefcts version/s" i tried any name variation I could imagine, but never got any results... sad

3 answers

try "affectedVersion"

This was one of the many many names i tried, ... no results:

 issueFunction in issueFieldMatch("project=xed", fixVersions, ".*") returns all issues with a fix version

 issueFunction in issueFieldMatch("project=xed", affectedVersion, ".*") does not returns anything.

I also tried affectedVersions, AffectedVersion, affectsVersion, affectsVserions, version, versions, .... and hundreds of other combinations. Never got any result...

Strange since this works (and should give also your wanted result) project =xed and affectedVersion is not empty

Hi Udo, what do you mean with "this works" ? You are getting results ? We are using Jira 6.1.6 and Script Runner 2.1.16 In the logging I find {code} 2014-11-05 11:33:50,234 http-bio-8080-exec-3 DEBUG [jira.groovy.jql.AbstractScriptedJqlFunction] Subquery (project=xed) took 15 ms 2014-11-05 11:33:50,234 http-bio-8080-exec-3 INFO [jira.groovy.jql.AbstractScriptedJqlFunction] Could not find field affectedVersion on issue DocumentIssueImpl[issueKey=XED-390] 2014-11-05 11:33:50,234 http-bio-8080-exec-3 INFO [jira.groovy.jql.AbstractScriptedJqlFunction] Could not find field affectedVersion on issue DocumentIssueImpl[issueKey=XED-389] ... {code} The issues XED-390 and XED-389 have field "Affects Version/s" filled in...

The query project =xed and affectedVersion is not empty (with a diferent project key) works on my side. so in JQL it is affectedVersion. Do use see those two issues if you run my query?

Sorry for the typo, I mean "do you see..."

Hi Udo, Yes, the JQL query works fine, but I think this does not proof the name "affectedVersion" also works in the issueFieldMatch function :-( . That's the core of my problem... Take the example of the fixVersion field: in a JQL query you have to use the name "fixVersion", in the issueFieldMatch the name of the field seems to be "fixVersions" (with an extra "s" at the end). The name "fixVersion" does NOT work in the issueFieldMatch function neither! I have no idea where the field names to be used in the issueFieldMatch come from...:-(

The field ID for "Affects Version/s" is "versions". The value compared is the list toString'd, so an empty list of Affects Versions will be []. Therefore .* will have to match everything. What is the query you are trying to do?

Hi Jamie,My query : project = xed AND issueFunction in issueFieldMatch("project=xed", version, ".*") I think we are getting closer. When I use "versions" (with or without quotes) as second argument, I get a red box with error "Error occurred communicating with the server. Please reload the page and try again". No errors in the log file. Any other name (for example "version" (without "s") just returns "No issues where found to match your search". And for every issue matching "project=xed" an error in the log file : http-bio-8080-exec-14 INFO [jira.groovy.jql.AbstractScriptedJqlFunction] Could not find field version on issue DocumentIssueImpl[issueKey=XED-1] Hope this helps, thanks for your help!

.... my query should read of course as project = xed AND issueFunction in issueFieldMatch("project=xed", versions, ".*") (with the "s" after versions)

Did you find the solution?

 

I am trying to use the Affects Version/s field in script validator and I receive this error:

"could not look up the type for this custom field, so we can't check this code.

possibly the field doesn't exist"

 

this is the script:

cfValues["Fixed in version/s"].toSet() == 'null' || cfValues["Versions"].toSet()

 

what I am trying to get is that "Fixed in version/s" can't filed as long as the "Affects Version/s" field is empty

 

Thanks !

It is not a custom field, it's a system field, so it's directly attached to the issue.

Try issue.getAffectedVersions()

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Published Thursday in Jira

Meet the AUG leaders of Northern Virginia

@Rachel Wright (Jira Genie), @Billy Poggi (AUG NOVA, DC), and @Dana Jansen (Confluence Queen) are just some of the folks that lead one of the world's most active Atlassian User Group (AUG)....

118 views 4 9
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you