IntelliJ IDEA Integration with JIRA Software(ScriptRunner)

I would like to set up IntelliJ IDEA to write scripts on groovy(ScriptRunner) in JIRA.

There are some questions about setting up an integration of IntelliJ IDEA Integration with JIRA Software (ScriptRunner) and I’d like to fix some troubles.

There are:

  • Windows Workstation 7 with IntelliJ IDEA 2018.1.6
  • Debian Linux Server 9.1 (stretch) with JIRA Software v7.5.4 (ScriptRunner plugin v.5.1.6)

I try to set up the environment like said here: “IntelliJ IDEA Integration” https://scriptrunner.adaptavist.com/latest/jira/intellij-integration.html
Successfully accomplished:

  • installed IntelliJ IDEA,
  • installed ScriptRunner IDEA integration plugin
  • switched on “Dark Feature” - “scriptrunner.idea.external.editor.enabled”
    Now I can open a new IntelliJ IDEA project when clicking on IntelliJ icon in ScriptRunner.

…and some troubles/questions here:

  1. How to change a default folder for project is created after clicking an “IntelliJ” icon in “Script Console”?

  2. As said in the documentation “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” But it doesn’t work. There aren’t any scripts in project folder is got from JIRA scripts folder
    How to fix it?
    Is it possible to create and update script files and Inline script between JIRA and IntelliJ IDEA project?

  3. Cause an error appeared in the bottom of IntelliJ it is impossible to open the second “IntelliJ” project then I clicking a IntelliJ icon in Scriptrunner.
    The error: “Argument for @NotNull parameter ‘project’ of com/intellij/openapi/project/DumbService.getInstance must not be null
    java.lang.IllegalArgumentException: Argument for @NotNull parameter ‘project’ of com/intellij/openapi/project/DumbService.getInstance must not be null…”
    How to fix it?

  4. As said in the documentation: “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. Just start typing, and your code will automatically show up in the ScriptRunner console! Magic!”
    I see “inline/src/main/java” folder but there is no folder (“inline/src/main/groovy”) and if I create groovy script file in the project under “inline/src/main/java” or “inline/src/main/groovy”(when I made it manually) or “inline/src/main/” and try to change it but nothing change in the other side(in inline script in JIRA or IntelliJ project file) - Magic doesn’t happend.
    How to fix it?

  5. Cause an error (“Argument for @NotNull parameter ‘project’ of com/intellij/openapi/project/DumbService.getInstance must not be null
    java.lang.IllegalArgumentException: Argument for @NotNull parameter ‘project’ of com/intellij/openapi/project/DumbService.getInstance must not be null…”) appeared in IntelliJ it is impossible to open the second “IntelliJ” project then I clicking a IntelliJ icon in Scriptrunner.
    How to fix it?

And now “Setting up a dev environment” https://scriptrunner.adaptavist.com/latest/jira/DevEnvironment.html

  1. After set up “External Tool for Running Scripts Against JIRA” I tried to run the tool I see the error on the result panel in IntelliJ IDEA:
    {“errorMessages”:[“Enter either a file name or a script.”],“flushedErrorMessages”:[“Enter either a file name or a script.”],“scriptRunResult”:null,“errors”:{}}
    and sometimes there wasn’t the error but no any result. Just wrote “Process finished with exit code 0”
    This works successfully only if I write accurate name of the script file which located in the scripts folder on JIRA server.
    How to make it works well with script file from IntelliJ IDEA?

Well…
As said in Adaptavist support there is a bug in the ScriptRunner IDEA Plugin.
So, wait when this bug will be solved and then a new release of ScriptRunner for JIRA plugin will be rolled up…
Just wait a new release…
https://productsupport.adaptavist.com/browse/SRJIRA-2807

Unfortunately as it is said in Adaptavist support there are no option here. Even an installation the old ones software can’t solve it.

Latest Intellij 2018.3 (183.5429.30) latest ScriptRunner plugin V0.7.16
Still same error as in p.5:
Argument for @NotNull parameter 'project' of com/intellij/openapi/project/DumbService.getInstance must not be null

Seems like patches didn’t work