Hi,
The Fix Version is a mandatory field for bugs.
However, when the resolution is not fixed (i.e. duplicate), there is no need for the Fix Version field.
I'm trying to get it work via Script Runner:
issue.resolution?.name != 'Fixed' || issue.fixversion is not empty
What is wrong?
Thanks,
Janiv.
I'm not really sure what you're trying to do, but you're mixing up groovy with what looks like JQL.
issue.resolution?.name != 'Fixed' || issue.fixVersions
will be true if the resolution is Fixed, or the fix version is not empty... however you can't unrequire a field that is required in the field config scheme.
Hey,
I want the FixVersion to be mandatory only if the resolution is Fixed.
Using the groovy I succeeded to unrequire a field that is required in the field config scheme.
If I use the following script: issue.resolution?.name != 'Fixed'
and remove theJIRA default mandatory field Condition
and I don't set the Fixed Version, it works !
All I have to do now, make sure that Fixed resolution must be set together with Fixed version one.
Can you help me pleasE?
Thanks,
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Which built-in script are you using? And is it a condition, validator, or post-function?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
It is a validator and I use the Groovy script (Script Validator -Runs a script to check validation).
Thanks,
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I'm totally confused. With many of the builtin scripts you can provide a condition which is in the form of a mini groovy script that returns true or not true. Are you using the one called Simple Scripted Validator? A screenshot would help here.
I think my original answer is correct. Try it in the Admin -> Built-in scripts -> Condition Tester.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Using the tester:
issue.resolution?.name != 'Fixed' || issue.fixversion is not empty
returns:
org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed: Script28.groovy: 1: expecting EOF, found 'is' @ line 1, column 55. = 'Fixed' || issue.fixversion is not emp ^ 1 error
Using the tester:
(issue.resolution?.name != 'Fixed') || (issue.fixversion?.name != '')
returns:
javax.script.ScriptException: groovy.lang.MissingPropertyException: No such property: fixversion for class: com.atlassian.jira.issue.IssueImpl Possible solutions: fixVersions
Thanks,
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Did you see what I put in my answer? It was:
issue.resolution?.name != 'Fixed' || issue.fixVersions
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I just noticed it ...
Thanks, it works great !
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.