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

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Class not found in Adaptavist Scriptrunner Script for TM4J

Jira Version: 7.13.0

Scriptrunner for Jira Version: 5.5.3

Test Management for Jira Version: 6.4.0-jira7


I copied this example script from here:


import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.Issue
import com.kanoah.testmanager.service.publicservice.IssueLinkPublicService
import com.onresolve.scriptrunner.runner.customisers.WithPlugin

//Must use @WithPlugin annotation to pick up Test Management for JIRA classes

def numberOfTests = 0
def numberOfPassingTests = 0

def issueLinkPublicService = ComponentAccessor.getOSGiComponentInstanceOfType(IssueLinkPublicService)

def countTestsInIssue = { Issue targetIssue ->
issueLinkPublicService.getTestCases(targetIssue.key, "lastTestResultStatus").each {
if (it.get("lastTestResultStatus") == "Pass") {

if ( == "Epic") {
ComponentAccessor.getIssueLinkManager().getOutwardLinks( {
if ( == "Epic-Story Link") {
} else {

if (numberOfTests == 0) {
return 100
return (double)(numberOfPassingTests * 100) / numberOfTests

and put it in an Automation for Jira rule.

When the rule gets executed, I get the following exception in atlassian-jira.log:

automation-rule-executor:thread-1 ERROR admin [c.o.scriptrunner.automation.ExecuteScriptIssueAction] *************************************************************************************
2019-06-25 10:09:28,889 automation-rule-executor:thread-1 ERROR admin [c.o.scriptrunner.automation.ExecuteScriptIssueAction] Script function failed on Automation for Jira rule: Sync Test cases status, file: <inline script>
java.lang.NoClassDefFoundError: com/kanoah/testmanager/service/publicservice/IssueLinkPublicService
at org.codehaus.groovy.jsr223.GroovyScriptEngineImpl.eval(
at org.codehaus.groovy.jsr223.GroovyScriptEngineImpl.eval(
at javax.script.AbstractScriptEngine.eval(
at javax.script.ScriptEngine$ Source)
at com.onresolve.scriptrunner.runner.ScriptRunnerImpl.runScriptAndGetContext(ScriptRunnerImpl.groovy:176)
at com.onresolve.scriptrunner.runner.ScriptRunner$runScriptAndGetContext$4.callCurrent(Unknown Source)
at com.onresolve.scriptrunner.runner.ScriptRunnerImpl.runStringAsScript(ScriptRunnerImpl.groovy:165)
at com.onresolve.scriptrunner.runner.ScriptRunner$runStringAsScript$ Source)
at com.onresolve.scriptrunner.canned.jira.utils.CustomScriptDelegate.doScript(CustomScriptDelegate.groovy:70)
at com.onresolve.scriptrunner.canned.jira.utils.CustomScriptDelegate$doScript$ Source)
at com.onresolve.scriptrunner.automation.ExecuteScriptIssueAction.executeScript(ExecuteScriptIssueAction.groovy:132)



2 answers

Looks like you're missing the dependency. I added  the same code into a ScriptedField and it worked fine for me

Hi Arthur,

quite late my answer, but did you try to remove the 1st line of code? (package

This made the post-function example work for me. 

Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Marketplace Apps & Integrations

5 mobile apps for Jira Cloud to boost productivity

  It’s very important to have access to the workflow process from anywhere. Especially if you manage the work of others. There is no difference whether you’re out of office, or drive a ca...

209 views 2 5
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you