Hello,
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
@ScriptListener
@Log4j
class SampleScriptListener implements CannedScript {
//Canned script code
}
<component key="testScript1" name="Sample Script"
class="com.onresolve.scriptrunner.canned.jira.workflow.SampleScriptListener" public="true"
application="jira">
<interface>com.onresolve.scriptrunner.canned.CannedScript</interface>
</component>
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!
Hello Vlad,
I think this docs https://scriptrunner.adaptavist.com/4.3.5/jira/scripting-other-plugins.html could help you. It shows how to develop scripts using other JIRA plugins services.
Regards,
Milos
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.