Skip to main content
The Adaptavist and Scriptrunner Logo
3 tips when writing custom ScriptRunner scripts
Share on socials
A script editor inside Jira exudes lightning and magic
An orange circle placeholder
Chirag Harendra
4th September, 2016
Jira
data_center icon
server icon
scripting

3 tips when writing custom ScriptRunner scripts

ScriptRunner makes simple Jira automations easy and more complex enhancements possible. If you're 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 you're 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.
For more information, check out the ScriptRunner documentation or contact us via the Adaptavist support portal.

More scripting tips

View snippets, FAQs and training
View resourcesarrow icon
An orange circle placeholder
Chirag Harendra
4th September, 2016
Jira
data_center icon
server icon
scripting
Related Article
Two Jira issues are highlighted in a sea of Jira issues
Jira
data_center icon
cloud icon
server icon

The Top 10 Jira Query Language (JQL) functions from ScriptRunner

ScriptRunner's scripted JQL functions are a life-saver to Jira admins performing many advanced search queries. Download our guide to the top 10 most used JQL functions now.
by
Jamie Echlin
on
26th September, 2019
Read morearrow icon