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

2 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)

Suggest an answer

Log in or Join to answer
Community showcase
Sarah Schuster
Posted Jan 29, 2018 in Jira

What are common themes you've seen across successful & failed Jira Software implementations?

Hey everyone! My name is Sarah Schuster, and I'm a Customer Success Manager in Atlassian specializing in Jira Software Cloud. Over the next few weeks I will be posting discussion topics (8 total) to ...

3,026 views 12 18
Join discussion

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
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot