How to include groovy scripts in jira add-on and run it in script runner

Hello.

I'am new to using groovy script runner and i use this plugin to do post functions. I want to wrap my groovy scripts in plugin. This is needed for version control and convenient maintenence these scripts.

How to make script runner identify scripts that located in plugin?

Thanks in advance for your support. 

1 answer

1 accepted

2 votes

Did you read https://scriptrunner.adaptavist.com/latest/jira/creating-a-script-plugin.html ? Warning though: that documentation needs some work, I don't know if it will work as written. But that's where you should be looking.

The other alternative is to make sure your "scripts" directory is a git repo, then you can just checkout the latest version or a floating label when you want to deploy changes.

I've read this article but it doesn't answer the question - how groovy runner will identify scripts that are in the plugin? I created simple Atlassian plugin with groovy "hello world" script, wrote groovy-runner dependencies, specified "plugin.script.roots" in pom.xml and as far as i understand, script should be transferred to this root on jira-server and script runner will execute it. But it doesn't happen. Please, correct me if i wrong,

It's not copied anywhere, but you should be able to run it from script console using the relative path from the jar root.

On the "files" tab, you should see eg plugin://My Awesome Plugin as well as the usual roots.

Found it, thanks a lot!

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Published Thursday in Jira

5 ways you can make the most of Jira Software and Bitbucket Cloud

As part of the Bitbucket product team I'm always interested in better understanding what kind of impact the use of our tools have on the way you work. In a recent study we conducted of software devel...

119 views 0 5
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