Setup and Upgrade - Riada-AB/InsightManager GitHub Wiki
IM is intended to be stored as a file on your JIRA server and imported as a library in to your scripts, the great benefit of this is that when you want to update IM you don't need to change all of your scripts, you just have to update the IM file on your server.
Requirements
- Insight version >= 6.3
- NOTE! The master branch requires minimum Insight 8.4, for <=8.3 use the master_<=8.3 branch
- JIRA Server
- A JIRA admin account
- ScriptRunner
- ScriptRunner is only a requirement for the current release of IM, a future release will also support using IM in groovy scripts executed by Insight.
Setup as a ScriptRunner library
IM expects a certain directory structure that you need to recreate on your server, with ScriptRunners new "Script Editor" this is simple to do even if you don't have access to the server OS.
Remember to use the master_<=8.3 branch if your running Insight <=8.3
Using ScriptRunner "Script Editor"
Requires ScriptRunner >= 5.6.7
- Go to ScriptRunners "Script Editor" interface
- Create the folder structure customRiadaLibraries/insightmanager/
- Create the file customRiadaLibraries/insightmanager/InsightManagerForScriptrunner.groovy
- Copy the contents of InsightManagerForScriptrunner to the new file and save
- Create the file customRiadaLibraries/insightmanager/SimplifiedAttachmentBean.groovy
- Copy the contents of SimplifiedAttachmentBean to the new file and save
- Start coding!
Using server OS access
This requires that you can log in to the JIRA servers OS and access the JIRA Home folder
- Go to the JIRA home folder (On Linux usually /var/atlassian/application-data/jira/)
- Create the folder structure scripts/customRiadaLibraries/insightmanager/
- Create the file customRiadaLibraries/insightmanager/InsightManagerForScriptrunner.groovy
- Copy the contents of InsightManagerForScriptrunner to the new file and save
- Create the file customRiadaLibraries/insightmanager/SimplifiedAttachmentBean.groovy
- Copy the contents of SimplifiedAttachmentBean to the new file and save
- Start coding!
Verifying the setup
After a successful setup you should be able to run this script in ScriptRunner console without any errors
import customRiadaLibraries.insightmanager.InsightManagerForScriptrunner
import customRiadaLibraries.insightmanager.SimplifiedAttachmentBean
InsightManagerForScriptrunner im = new InsightManagerForScriptrunner()
im.log.warn("IM is wokring")
Setup as an Insight library
Soon to be implemented!
Adding IM directly to your script
You can take the contents of InsightManagerForScriptrunner and put it directly in to your script, however this is not recommended as it will lead to a lot of redundant code, complicate your script and make updating IM very labor intensive.
Upgrading IM
Upgrading IM is a simple as replacing the contents of the files on the server ($JIRA_HOME/scripts/customRiadaLibraries/insightmanager/) which can be done with ScriptRunner "Script Editor", but due to caching in JIRAs JVM the change isn't always picked up. If you are having problems in a production environment there are a couple of things you can try.
- Simply restarting JIRA is usualy a certain fix
- If restarting is not an option you can try making a small edit to the script not picking up the change. Any change that requires the JVM to recompile your script (not comments) will load the new version of IM.
- You can try ScriptRunners Built-In functionality to clear caches.
Add IM to your Intellij Project
If you develop your JIRA scripts using Intellij you can use it to check out this repo as a project, then open up your existing project and add IM as a module and add dependency on that module to your existing module in that project.