ScriptRunner brings the power of software development tools to the platform you use every day to track the software development life cycle. To help you write better scripts faster, ScriptRunner integrates with the best-in-class IDE, IntelliJ IDEA.

More information about IntelliJ IDEA can be found on the JetBrains site here.

Developing scripts with IntelliJ allows you to:

  1. Accelerate development - IntelliJ will give you recommendations on which functions, methods, and variables you can use

  2. Access all your scripts - Securely manipulate any configured script, including those saved in your script roots

Developing with IntelliJ IDEA

Working with IntelliJ makes development easier. We still recommend that you do development in a testing environment before pushing your changes to production. Using the IntelliJ IDEA integration makes getting feedback from your scripts in a safe testing environment easier and faster.

Getting Started

First, you will need to install IntelliJ IDEA. You can download either the free Community edition or the paid Ultimate edition from the Jetbrains site.

Once you have IntelliJ installed, you will need to install the ScriptRunner IDEA integration plugin.

intellij view plugins

From the plugins menu on the loading screen, choose Browse Repositories and search for ScriptRunner

browse repositories

Install this plugin and restart IntelliJ.

install scriptrunner

You are now ready to connect to IntelliJ!

Connecting to IntelliJ

From anywhere in ScriptRunner where you write scripts (for instance, the Script Console), you now have an IntelliJ IDEA icon at the bottom-right corner of the console. With IntelliJ running, simply click this icon.

idea icon

Once complete, navigate back to the Script Console and click the IntelliJ icon.

ScriptRunner will connect to IntelliJ and begin to create a project for you to work in. The first time you set this up it may take a few minutes, as it’s downloading all the necessary libraries for developing with ScriptRunner and your Atlassian product.

downloading sources

While this is happening, you can also navigate to to gain a copy of the source code for your Atlassian product. This is available to anyone with a paid, non-starter license of Atlassian products. When you have downloaded the appropriate source zip, simply extract it on your computer and link this to your IntelliJ project; see the guide on our Setting up a Development Environment page for more detail. You should only have to do this one time.

Developing with IntelliJ

Once you have everything linked up, you will see a few key areas in IntelliJ. First off, ScriptRunner has automatically created a project for you to work in, as well as a groovy script file which will automatically link to your running console. The new file will be under inline/src/main/groovy.

sample intellij auto project

Just start typing, and your code will automatically show up in the ScriptRunner console! Magic!

You will also see a folder on the left called Script Roots. IntelliJ will automatically sync the scripts on the Script Root folder of your Atlassian product, and allow you to modify those files directly in IntelliJ. From here, you can run files from the Script Root as you normally would in ScriptRunner.

script root

Happy scripting!

Things to watch out for

SSL Certificate

If this is your first time running the IDEA editor, there is one more step you will need to do to enable the communication between ScriptRunner over the local network connection. When presented with this dialog, simply follow the instructions in step 2 for allowing http traffic over the local network when connecting to ScriptRunner.

ssl warning
ssl warning complete
Setting a JDK:

If you can find classes but IntelliJ is not giving you code completion recommendations, it is likely that there is no JDK for the project set. When you open the project the first time you should be prompted to set a JDK, but you can set this at any time by going to File > Project Structure and set a JDK version.

Please give us Feedback

We are actively developing this feature, and would love your feedback. Please file any questions or improvements at our JIRA Service Desk. We look forward to hearing from you!

Have questions? Visit the Atlassian Community to connect, share, and learn with other Atlassian users and experts, including Adaptavist staff.

Ask a question about ScriptRunner for JIRA, Bitbucket Server, or Confluence.

Want to learn more? Check out courses on Adaptavist Learn, an online platform to onboard and train new users for Atlassian solutions.