Sort by Topics, Resources
Clear
Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.

Salto for

Jira

Articles

SHARE

Managing ScriptRunner Scripts Like Code with Salto

Rachel Wright

April 30, 2025

5

min read

At some point in your Jira administration journey, you’ll inevitably have additional configuration needs and start to wonder what else is possible. The Jira configuration is very flexible and customizable, but what happens when you need even more? What happens when your organization's use case lies just outside Jira’s native capabilities? That’s when we look to third-party apps and custom scripting to bring additional functions and customizations to our applications. But with additional complexity comes additional risk. Luckily, Salto recognizes the need to protect additional settings outside the standard Jira configuration. They’ve added support for scripts from Adaptavist’s popular ScriptRunner for Jira app. This integration is yet another way Salto helps Jira administrators manage their Jira application more effectively.

Automate the way you migrate Jira configurations from sandbox to production

ScriptRunner Notification Example 

Jira already sends email notifications to assignees, reporters, and watchers. But have you ever wanted to send a special, custom email notification when a work item or issue reaches a specific status? There are many ways to accomplish this. You could use a custom event, an automation rule, or you could use an app like ScriptRunner. Here’s a simple use case. When a work item transitions to the final “Done” status, send a custom email notification to a specific user. Here’s how to build this capability, using a sample script from Adaptavist’s script library

First, I built a simple workflow with three statuses: To Do, In Progress, and Done. In the Done transition, I added a new “ScriptRunner post function”. Post Functions are additional rules or actions that occur after a workflow transition.  

Adding a ScriptRunner Post Function to a workflow transition

Then, I selected the “Send Notification” action from the list of additional post function actions ScriptRunner provides.

Select the “Send Notification” option to email a customized message after a transition

Next, I entered all the criteria for the notification, such as the user to send the message to, the message’s subject, and the user Jira should log as the initiator. In the “Message” field, I pasted an example script to specify the information to include in the email body. I made some minor modifications and added some HTML line breaks. The script contains variables like the work item’s key, assignee, priority, description, and reporter.

Example message body script

Example message body script in the Jira post function

Next, I saved the rule and published the workflow. Finally, I tested the post function and script by transitioning a Jira work item to the Done status. In ScriptRunner and in the workflow post function, Jira shows that the script executed successfully. 

Successful execution in ScriptRunner

Successful execution of the workflow post function

The last thing I checked was that the email message was received, the message body contained the expected variables, and the message was formatted as desired.

Custom notification message with variables and formatting

I’ll admit that it took me a couple of tries to get the message to look as pictured above. I needed to make a small script change, transition the work item out of and back to the Done status, and review the resulting email a few times to get it right.

Now that I have spent some time customizing the script and getting the message to look the way I want, I want to ensure that the script is protected so I can check it into a code repository, deploy it to production, and never have to write or customize it again. That’s where Salto comes in!

Exploring ScriptRunner Scripts in Salto

One of the things I love about Salto is that it stores Jira configurations as easy-to-read text files. Simply open a workflow file in Salto to view a text-based representation of the workflow settings, including statuses, transitions, properties, behaviors, and post functions that contain ScriptRunner scripts.

A text representation of a workflow in Salto

You can also search for any unique string or keyword in your script, and Salto will find that information immediately. For example, I searched for the string “Issues.getByKey” which appears in the first line of my script. Salto found the workflow file containing the script and opened it at the location where the script starts. Now I know my ScriptRunner script is safe and sound and part of my Jira change management process.

ScriptRunner script in Salto

Benefits of Using ScriptRunner with Salto

With ScriptRunner support in Salto, you can automatically deploy or rollback script changes with ease. There’s no need for a manual and error-prone copy-and-paste process to move, update, or rollback scripts between sandbox and production environments. This integration enables you to compare scripts across multiple Jira applications or sites, allowing you to identify and manage any differences.

With Salto, ScriptRunner code is now part of a robust change management process where you track Jira configuration changes, collaborate with fellow Jira administrators using pull requests, and deploy changes to production.

Activities to Try

Now it’s your turn! Add Adaptavist’s ScriptRunner for Jira app to your Jira application. There’s a version for Cloud and Data Center. Start a free trial from marketplace.atlassian.com or from Admin > Apps > Find new apps. 

Ideas

  • Create a ScriptRunner post function to clone a work item, transition a parent issue, create a sub-task, and more.
  • Create a ScriptRunner script listener to sum story points in an epic, check the value of a custom field when it changes, update an estimate in a parent work item, and more.

Then, fetch your Jira data in Salto and see your scripts there!

Resources

WRITTEN BY OUR EXPERT

Rachel Wright

Atlassian Consultant

Rachel Wright started using Jira and Confluence in 2011, became an administrator in 2013, and was certified in 2016. Rachel also uses Atlassian tools in her personal life for accomplishing goals and tracking tasks. Her first book, the “Jira Strategy Admin Workbook“, was written in Confluence and progress was tracked in Jira!

Sort by Topics, Resources
Clear
Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.

Salto for

Jira

Jira

SHARE

Managing ScriptRunner Scripts Like Code with Salto

Rachel Wright

April 30, 2025

5

min read

At some point in your Jira administration journey, you’ll inevitably have additional configuration needs and start to wonder what else is possible. The Jira configuration is very flexible and customizable, but what happens when you need even more? What happens when your organization's use case lies just outside Jira’s native capabilities? That’s when we look to third-party apps and custom scripting to bring additional functions and customizations to our applications. But with additional complexity comes additional risk. Luckily, Salto recognizes the need to protect additional settings outside the standard Jira configuration. They’ve added support for scripts from Adaptavist’s popular ScriptRunner for Jira app. This integration is yet another way Salto helps Jira administrators manage their Jira application more effectively.

What if Zendesk was 4x less work?

Request a Demo Get started with Salto

ScriptRunner Notification Example 

Jira already sends email notifications to assignees, reporters, and watchers. But have you ever wanted to send a special, custom email notification when a work item or issue reaches a specific status? There are many ways to accomplish this. You could use a custom event, an automation rule, or you could use an app like ScriptRunner. Here’s a simple use case. When a work item transitions to the final “Done” status, send a custom email notification to a specific user. Here’s how to build this capability, using a sample script from Adaptavist’s script library

First, I built a simple workflow with three statuses: To Do, In Progress, and Done. In the Done transition, I added a new “ScriptRunner post function”. Post Functions are additional rules or actions that occur after a workflow transition.  

Adding a ScriptRunner Post Function to a workflow transition

Then, I selected the “Send Notification” action from the list of additional post function actions ScriptRunner provides.

Select the “Send Notification” option to email a customized message after a transition

Next, I entered all the criteria for the notification, such as the user to send the message to, the message’s subject, and the user Jira should log as the initiator. In the “Message” field, I pasted an example script to specify the information to include in the email body. I made some minor modifications and added some HTML line breaks. The script contains variables like the work item’s key, assignee, priority, description, and reporter.

Example message body script

Example message body script in the Jira post function

Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.

Next, I saved the rule and published the workflow. Finally, I tested the post function and script by transitioning a Jira work item to the Done status. In ScriptRunner and in the workflow post function, Jira shows that the script executed successfully. 

Successful execution in ScriptRunner

Successful execution of the workflow post function

The last thing I checked was that the email message was received, the message body contained the expected variables, and the message was formatted as desired.

Custom notification message with variables and formatting

I’ll admit that it took me a couple of tries to get the message to look as pictured above. I needed to make a small script change, transition the work item out of and back to the Done status, and review the resulting email a few times to get it right.

Now that I have spent some time customizing the script and getting the message to look the way I want, I want to ensure that the script is protected so I can check it into a code repository, deploy it to production, and never have to write or customize it again. That’s where Salto comes in!

Exploring ScriptRunner Scripts in Salto

One of the things I love about Salto is that it stores Jira configurations as easy-to-read text files. Simply open a workflow file in Salto to view a text-based representation of the workflow settings, including statuses, transitions, properties, behaviors, and post functions that contain ScriptRunner scripts.

A text representation of a workflow in Salto

You can also search for any unique string or keyword in your script, and Salto will find that information immediately. For example, I searched for the string “Issues.getByKey” which appears in the first line of my script. Salto found the workflow file containing the script and opened it at the location where the script starts. Now I know my ScriptRunner script is safe and sound and part of my Jira change management process.

ScriptRunner script in Salto

Benefits of Using ScriptRunner with Salto

With ScriptRunner support in Salto, you can automatically deploy or rollback script changes with ease. There’s no need for a manual and error-prone copy-and-paste process to move, update, or rollback scripts between sandbox and production environments. This integration enables you to compare scripts across multiple Jira applications or sites, allowing you to identify and manage any differences.

With Salto, ScriptRunner code is now part of a robust change management process where you track Jira configuration changes, collaborate with fellow Jira administrators using pull requests, and deploy changes to production.

Activities to Try

Now it’s your turn! Add Adaptavist’s ScriptRunner for Jira app to your Jira application. There’s a version for Cloud and Data Center. Start a free trial from marketplace.atlassian.com or from Admin > Apps > Find new apps. 

Ideas

  • Create a ScriptRunner post function to clone a work item, transition a parent issue, create a sub-task, and more.
  • Create a ScriptRunner script listener to sum story points in an epic, check the value of a custom field when it changes, update an estimate in a parent work item, and more.

Then, fetch your Jira data in Salto and see your scripts there!

Resources

WRITTEN BY OUR EXPERT

Rachel Wright

Atlassian Consultant

Rachel Wright started using Jira and Confluence in 2011, became an administrator in 2013, and was certified in 2016. Rachel also uses Atlassian tools in her personal life for accomplishing goals and tracking tasks. Her first book, the “Jira Strategy Admin Workbook“, was written in Confluence and progress was tracked in Jira!