NoClassDefFoundError while using agile JiraSoftwareFeature in Scriptrunner REST Endpoint

sanna November 23, 2016

hi,

Here's my code. I put the code into a groovy file not inline.

I got a JiraSoftwareFeature  NoClassDefFoundError .

someone can help? 

JIRA version:7.1.2

scriptrunner version:4.3.1

----------------------------------------------------------------------------

import .....

 

@WithPlugin("com.pyxis.greenhopper.jira")

@JiraAgileBean

JiraSoftwareFeatureService jiraSoftwareFeatureService

 

@BaseScript CustomEndpointDelegate delegate

doSomething(httpMethod: “GET", groups: ["jira-administrators"]) { MultivaluedMap queryParams, String body ->

   def enabled = jiraSoftwareFeatureService.isFeatureEnabled(JiraSoftwareFeature.PARALLEL_SPRINTS)

  return Response.ok(new JsonBuilder([abc : enabled]).toString()).build()

}

 

4 answers

0 votes
sanna December 7, 2016

Greenhopper is a bundled plugin in JIRA 7.1.2, and version is 7.1.20.

 

0 votes
Jonny Carter
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
December 7, 2016

I can't find the class com.atlassian.greenhopper.features.JiraSoftwareFeature, even in the JIRA Software source. I can find a JiraAgileFeatures class in the same package in the API docs (https://docs.atlassian.com/jira-software/6.7.12/com/atlassian/greenhopper/features/package-summary.html), but I'm not sure that's what you need.

Based on the enum property you're after (PARALLEL_SPRINTS), I think you want is https://docs.atlassian.com/jira-software/6.7.12/com/pyxis/greenhopper/jira/configurations/BetaFeatures.html

I also can't seem to find any documentation for a JiraSoftwareFeatureService. That's probably just because parallel sprints is still in labs; the API is probably changing rapidly, and I just need a particular version of the source. Did you have another base you were working from to help you divine the API needed for parallel sprints?

0 votes
sanna December 1, 2016

hi, Jonny Carter. Thanks in advance.

I'm sure that I imported all the classes as possible as I can.

My imports :

----------------------------------

import com.atlassian.greenhopper.features.JiraSoftwareFeature

import com.atlassian.greenhopper.service.configuration.JiraSoftwareFeatureService

import com.onresolve.scriptrunner.runner.customisers.JiraAgileBean

import com.onresolve.scriptrunner.runner.customisers.WithPlugin

import com.onresolve.scriptrunner.runner.rest.common.CustomEndpointDelegate

import groovy.json.JsonBuilder

import groovy.transform.BaseScript

import javax.ws.rs.core.MultivaluedMap

import javax.ws.rs.core.Response

0 votes
Jonny Carter
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 30, 2016

Think you could include the whole code block, imports and all?

Suggest an answer

Log in or Sign up to answer