Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,463,448
Community Members
 
Community Events
176
Community Groups

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.

8 answers

1 accepted

2 votes
Answer 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.

JamieA Rising Star Mar 21, 2016

no worries, thanks for updating this.

https://scriptrunner.adaptavist.com/5.5.5/jira/recipes/behaviours/select-list-other.html#_make_a_field_writable_only_if_a_certain_value_is_set_in_another_field

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

0 votes
JamieA Rising Star Mar 13, 2016

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

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

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.

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

 

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.

0 votes
Phill Fox Community Leader Mar 12, 2016

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)

Suggest an answer

Log in or Sign up to answer
TAGS

Atlassian Community Events