Using this as an example: https://scriptrunner.adaptavist.com/latest/jira/recipes/behaviours/select-list-other.html
the sample code has not effect on the targeted field. So I tried another approach. No errors reported in the chrome inspector, lots of errors in the JIRA log.
1 error
org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
General error during instruction selection: java.lang.NoClassDefFoundError: Unable to load class com.onresolve.scriptrunner.runner.customisers.RapidViewServiceBridge due to missing dependency com/atlassian/greenhopper/service/rapid/view/RapidViewService
java.lang.RuntimeException: java.lang.NoClassDefFoundError: Unable to load class com.onresolve.scriptrunner.runner.customisers.RapidViewServiceBridge due to missing dependency com/atlassian/greenhopper/service/rapid/view/RapidViewService
the script:
def bleedField = getFieldByName('Bleed')
def otherBleedField = getFieldById('customfield_11403')
def bleedFieldVal = bleedField.getValue()
if (bleedValueVal){
if (bleedFieldVal == "Other"){
otherBleedField.setHidden(false)
otherBleedField.setRequired(true)
}else{
otherBleedField.setHidden(false)
}
}else{
otherBleedField.setHidden(true)
}
So I tried the exact syntax from the example again
def otherBleedField = getFieldByName("Bleed (Other)")
def bleedField = getFieldById(getFieldChanged())
def selectedOption = bleedField.getValue() as String
def isOtherSelected = selectedOption == "Other"
otherBleedField.setHidden(! isOtherSelected)
otherBleedField.setRequired(isOtherSelected)
and the field is hidden and nothing can be done to change that. And this is a plugin for which I've paid for a 50 user license. Going to file this on their support site (? exists ?) now.
Resolution: put the script in the 'serverside script' input, not the initialiser input. And add the 'other' field to the configuration as a hidden item.
Thanks Jamie, this one was operator error.
no worries, thanks for updating this.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The example still not working- last ScriptRunner version (5.5.5).
Resolution: put the script in the 'serverside script' input, not the initialiser input.
Is there any fix? Or description on this page has to be changed
https://scriptrunner.adaptavist.com/5.5.5/jira/behaviours-overview.html
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
We'll work on the support ticket you have created, then when resolved make an update here for others.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
All set. Would you like this issue reported in the support portal?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Brian,
Sorry you had trouble signing up to our support portal. Please try this link and choose the Sign up for an account link from there.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Also, I am happy to file a support request at https://productsupport.adaptavist.com/servicedesk/customer/user/login?destination=portals but I don't have a valid username and can't seem to get one.
I just tried to move the script into a file, and when I tried to save the behavior with a pointer to a place where I keep my scripts, it fails with the error:
Class must extend class com.onresolve.jira.groovy.user.FieldBehaviours. | |
Enter the package name and class for this validator OR the location of the file. | |
Enter the name of the method to execute. If you are pointing to a script rather than a class use the method name: *run* |
I see this in the logfile:
016-03-13 12:08:49,263 http-bio-8090-exec-56 ERROR admin 728x1315577x3 1axg31p 32.212.197.235,127.0.0.1 /rest/scriptrunner/latest/canned/com.onresolve.scriptrunner.canned.common.StaticCompilationChecker [common.error.jersey.ThrowableExceptionMapper] Uncaught exception thrown by REST service: startup failed:
General error during instruction selection: java.lang.NoClassDefFoundError: Unable to load class com.onresolve.scriptrunner.runner.customisers.RapidViewServiceBridge due to missing dependency com/atlassian/greenhopper/service/rapid/view/RapidViewService
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi, thanks Phill. It is version 6.4.10. There is no JIRA Agile installed. Once there was, I think as a trial of the plugin.
If it helps, I have some script postfunctions that are working fine. That might not be your plugin though, I guess.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Please refer to https://scriptrunner.adaptavist.com/latest/jira/getting-help.html for how to request help from Adaptavist in future.
But to pick up and assist you now.
Can you confirm the version of JIRA.
If version 7.x whether this is JIRA Core or JIRA software.
If an earlier version than 7.0 what version of JIRA Agile is installed?
The class reported as missing in your logifiles is part of the Agile implementation in JIRA (greenhopper was the original Agile plugin name)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.