Adaptivist Script Runner - basic select list with other example recipe doesn't work

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.

7 answers

1 accepted

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.

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)

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.

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

 

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.

All set. Would you like this issue reported in the support portal?

0 vote

We'll work on the support ticket you have created, then when resolved make an update here for others.

Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Fadoua M. Boualem
Published Monday in Trello

Using Trello to manage events

As a Jira power user, I was at first doubtful that Trello could benefit my workflow. Jira already uses boards (ones you can customize!), so why would I even need to use Trello?! In this post you will...

498 views 8 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