How can I import a custom plugin class into a Scriptrunner script?


I am working on a plugin that I want to use as a sort of custom library for JIRA. I want to wrap up usual operations like getting a custom field's value, setting it, migrating a issue to a new workflow, etc so i remove the thousand of lines of redundant code in our instance.

I am follwing Adaptavist's instructions about creating bundled scripts and I downloaded their bundled script plugin example.

My problem is that I can't manage to import a custom class into my Script Console. I have a custom class (currently just using the one implemented in teh Adaptavist example) that i tried adding as a component in atlassian-plugin.xml:


package com.onresolve.scriptrunner.canned.jira.workflow

import com.onresolve.scriptrunner.canned.CannedScript
import com.onresolve.scriptrunner.canned.util.BuiltinScriptErrors
import com.onresolve.scriptrunner.canned.util.SimpleBuiltinScriptErrors
import com.onresolve.scriptrunner.runner.customisers.ScriptListener
import groovy.util.logging.Log4j

class SampleScriptListener implements CannedScript {

//Canned script code

<component key="testScript1" name="Sample Script"
class="com.onresolve.scriptrunner.canned.jira.workflow.SampleScriptListener" public="true"


The problem is if I try to import com.onresolve.scriptrunner.canned.jira.workflow.SampleScriptListener in a groovy script, i get an unresolved reference error for my import.

I have this question floating around but I still haven't found a solution that works for me. Has anyone managed to get this to work? If yes, could you please share how you did it? I've been trying to do this for quite some time with no success.


Thank you!

1 answer

Hello Vlad, 

I think this docs could help you. It shows how to develop scripts using other JIRA plugins services.



Suggest an answer

Log in or Sign up to answer
Community showcase
Published Nov 27, 2018 in Portfolio for Jira

Introducing a new planning experience in Portfolio for Jira (Server/DC)

In the past, Portfolio for Jira required a high degree of detail–foresight that was unrealistic for many businesses to   have–in   order to produce a reliable long-term roadmap. We're tur...

2,574 views 15 21
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