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...
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()
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks !
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Strange since this works (and should give also your wanted result) project =xed and affectedVersion is not empty
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign 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?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Sorry for the typo, I mean "do you see..."
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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...:-(
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
.... my query should read of course as project = xed AND issueFunction in issueFieldMatch("project=xed", versions, ".*") (with the "s" after versions)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
try "affectedVersion"
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.