Script Console

Before you start 

Learn how to modify existing scripts in the Script Console.



What is the Script Console?

The script console is a place to run scripts. Using the script console, you can copy and paste or write a script to run in Jira Cloud. The Script Console enables you to run one-off ad hoc scripts and helps you learn and experiment with the Jira REST API from ScriptRunner. 

You find a script editor, similar to the script console, anywhere you choose to use a custom script option (for example, when adding a listener or scheduled job).

The script console is useful for testing scripts or performing operations that you only want to do once. So if you want a list of all the spaces on your instance and some details about them, you can run a script for that. Or if you want to delete all spaces that were created by a certain person, you can do that. You can also run maintenance scripts that modify something on your instance.

Like all coding fields in ScriptRunner for Jira Cloud, the script console uses an intelligent code editor. Learn more in the Code Editor documentation. The editor has autocomplete for the following code: 

  • Groovy
  • Atlassian REST API
  • Automatically available variables

You can see autocomplete in the following screenshot: 

How to Use the Script Console

You can either enter the script you want to run directly in the Script field or click the Example scripts button to select an example script. 

If you choose to reuse one of the many examples provided, rather than writing your own script, you will see the following screen:

  1. Choose an example script from the list provided and the code automatically appears. You also have the option to search for a particular script.
  2. Click Copy Code and then Close.
  3. Paste the copied code in the code editor.

You can use the Script Console to:

  • Run a script to display information.
  • Run a one-off clean up task.
  • Make one-off or bulk updates to issues, projects, users, versions etc.

For example, as an admin, you have been given a list of users who have left the company. For security reasons, you need to remove these users as soon as possible. Usually, you would need to search for each name individually and manually delete each user. However, I can enter the list of user names and bulk delete all of them in one action using a script in the Script Console.

Using the Script Console is an easy way to make bulk changes to issues returned by a JQL query. For example, I can look for issues with linked support cases and no watchers so I can then automatically add the linked support cases reporter to the related bug as a watcher.


Take our ScriptRunner Tour to help you get started with the Script Console and gain access to helpful videos and demos.

shortcut ScriptRunner Tour

On this page