3 tips when writing custom ScriptRunner scripts
ScriptRunner makes simple JIRA automations easy and more complex enhancements possible. If youre already using ScriptRunner for JIRA, you'll probably be thinking about how custom scripts can address your specific automation needs. Read on for 3 essential tips when writing custom ScriptRunner scripts.
Test, debug and tweak for custom ScriptRunner scripts
If youre writing your own scripts, you'll want to make sure you can test, debug and tweak them. That's where these best practice tips come in. One way to figure out what's going on with your scripts is to write logging messages in your JIRA log files. It's easy to set these up with ScriptRunner.
#1: Include logging statements in your scripts
A great way to get started if you're new to writing ScriptRunner scripts is to include logging statements. They let you diagnose exactly what is happening with your code especially useful if it's not doing what you expect it to.
#2: Use an IDE to write your scripts
Writing a script by simply using the Javadoc can be painful. If your code is complex and logging statements are not enough you'll benefit from setting up an IDE. Click below to find out how to set up your application and Intellij IDEA 14 with Groovy.
#3: Include automated testing in your scripts
Automated testing gives you added peace of mind when developing scripts. You'll ensure that your script does what you want it to, including when there are corner cases that you might not have anticipated.