Scriptrunner library

Scriptrunner library DEFAULT

It's not the same without you

Hi guys. I'm Daniel Yelamos, one of the developers for the ScriptRunner for JIRA team at Adaptavist. I'm going to tell you a bit about our new project, the Adaptavist Library, what it does, and how it came to be. 

When I joined the ScriptRunner development team, back in April 2017, one of my early objectives was to learn what the product does by helping customers achieve their multiple use cases, which led me to work with the customer support team quite closely.

At Adaptavist, we believe it be the norm, and not the exception, to have excellent customer support. As many of us would say, offering good support is always hard, but rewarding work. After a few months, I found that lots of users were coming to the support team and the community for similar issues. The same, easily solved issues kept coming up again and again and I was referring users back to answers I had already given to other users. Things like; "How to get the issue keys of your linked Issue?", "How to send a REST request?", "How to create Epics or tasks?", and the list goes on. It was a bit too manual for my taste. I had to go to my profile, search for the right answer, make sure that was what the user wanted, and send it again. It was hard keeping the reference to the answer and how it could relate to future questions together. Also, if we had a good answer, or use case on an old question, we had no way of knowing if it still worked on the most recent ScriptRunner versions. Sometimes customers and even myself would get confused between cloud or server versions, as the type of script wasn't always very visible in the community question. 

The library was suggested by a few developers who also felt that the process was too manual.

“It would be awesome if we owned a domain in which we could keep all of these scripts together," we suggested.

That way, we would have a centralised place to refer customers back to and give them the capability of searching for scripts themselves.

"We could set up a testing framework to make sure that the scripts still work, and that way we can keep updating them if they changed at a later date while always referring to the same URL.”

It would be a good year and a half until I could work on the project.

After months of hard work, we finally had a suitable beta for the library, which you can access here:

This first release allows users to search for collections of similar scripts. One such collection is; "Getting started with JIRA Issues", which contains scripts to get you started, and covers the most common basic use cases.

You can also search for keywords, such as, "Behaviours", "Link" or "Priority".

Once you've found the scripts you need, you can add them to your collection to keep track of them and make sure that they are relevant to your Jira and ScriptRunner version.

Hopefully, this post will boost the library's visibility within the awesome community, and more of you will be able to use it to find solutions. We're very open to your feedback and help us help you to improve your experience.

You can comment directly to give us feedback, or you can use the Submit feedback button in the Adaptavist Library. 

If you are interested in any more information about the Library, I recommend this post from one of my colleagues describing the library in more detail. 

Thanks for reading, and happy script searching!


ALM Works

ALM Works is pleased to be an inaugural partner in the new Adaptavist Library. In his latest blog post, ALM Works Solutions Engineer, Phil Heijkoop shares his insights on the benefits of using ScriptRunner with Structure for Jira.

Building upon the integration Adaptavist and ALM Works created between ScriptRunner and Structure, we are happy to share a collection of Structure-specific scripts in the Adaptavist Library.

Here’s some background: ScriptRunner allows you to automate manual work that can take up a fair bit of time, and do it without introducing human error.

For example, we recently had the opportunity to work with a customer who wanted to share the power of Structure from one business group to 50+ groups in his company. Instead of manually recreating the structures he’d already built, we worked with him to write a series of ScriptRunner scripts, which allowed him to replicate the structures across all the business groups by altering just one element of his Structure Automation Rules (in this case, the “project =” portion of the Inserter JQL).

This accelerated the rollout of Structure to the rest of the company’s project managers since each PM now had proven, tailored-for-them structures to work with. This also made it easier for them to conceptualize the power of Structure in a very tangible and relevant way. Through this roll-out process, they were able to get started with relevant, personalized structures with little-to-no effort, easily seeing what Structure could accomplish as they added additional custom structures.

Furthermore, the scripts served as an easy way to reset any (or all) of the structures that were built, since they could easily be copied, deleted or recreated at the press of a button.

Here’s how we did it.

We first took an existing structure and worked with our customer to identify the essential elements that he wanted to share with the other groups.

Next we looked at how he wanted to extend this further. In this particular case, he wanted to tie each Team to a Project. So we created a list to iterate through.

Then we used the Structure-scripts in the Adaptavist Library to build a single master script for this use-case, turning his structures into templates if you will.

We then tested his script on our own testing instance to make sure it worked as expected. Once everyone was satisfied with the work and testing, we rolled it into the customer’s production environment.

Now he has means to build and roll out more structures as new Teams and Projects get added to the company portfolio, or to share useful structures with the entire organization without needing everyone to manually rebuild them.

There’s more: The folks over at Adaptavist have written a deeper dive blog post about the Structure scripts in the Library with a few excellent use-cases of their own. We will continue working with them in the coming months to add new Structure-specific scripts to their library as each of us uncovers new customer use cases for ScriptRunner & Structure.

If you have script ideas you’d like to share, or if there are Structure/ScriptRunner uses cases you’d like to explore, you can reach me via email. I’d love to hear from you.

Check out the Structure scripts in Library for yourself.

  1. Broan exhaust fan
  2. Bnha endeavor
  3. Vita steel rings
  4. Hallmark matchmaker movie
  5. Single mom scholarships 2015

Portal Edition R1 is the first release in a series of versions that focus on expanding the role-based ScriptRunner Portal and completely replacing the previous Web Apps.

Release 1 introduces many new features around the management and development of scripts and makes them available for the first time in the Portal app “Scripts” in the browser:

  • Integrated Script Editor
  • View, modify and save scripts directly in the Script Library
  • Controlled access with check-out and check-in of scripts
  • Versioning of scripts and comparison of versions
  • Restore versions
  • Import of own scripts and scripts from ScriptRunner ActionPacks
  • Development of new scripts with templates

Further features in Release 1 are:

  • Separation of Licensing and Settings Portal App
  • Online ordering additional licenses in the Licensing App
  • Canceling an action still in progress in the Run App
  • Additional WYSIWYG settings on Actions

Release 2 of the Portal Edition will go public in September and will cover configuration elements and multi-backend capabilities.

The old End User Self-Service App and Help Desk App will be dropped from this release without replacement.

The final stage of development will be Release R3 with full configuration capabilities in the Portal.

Settings for the Script App on the Server

Different modes can be set for the operation and functions of the Script App. The choice of modes depends on the work and workflow model for script development. In principle, two working models can be distinguished:

  • Developing scripts by a few administrators directly on ScriptRunner. This is a one-step procedure. Each administrator is solely responsible for their developed scripts. They can import scripts directly into ScriptRunner, create new scripts and change them. Versioning and control of editing is done in ScriptRunner.
  • Develop scripts using code management systems in a multi-step development process, such as GitHub, GitLab, Bitbucket, etc. Administrators develop scripts in various repositories under control of code management. The release processes for the scripts, versioning and control of editing the scripts is done there and not on ScriptRunner Server.

The settings can be viewed in the Settings App under Script Library.

Screenshot: PowerShell Library settings in ScriptRunner Portal Edition R1

Script App settings

The appropriate mode is set on ScriptRunner Server with the command

Set-AsrSettings -ScriptEditMode On/Off/ViewOnly/Restricted -restart
Get-help Set-AsrSettings -Full

The New Script Edit Modes

ON (default)

This setting allows all administrators to import, recreate, check out, check in, modify, revoke or reset scripts to an old state in the ScriptRunner Portal. This meets the requirements for the working model with a one-step development process.


The script editor functions are completely disabled. The code of the scripts is not displayed. This setting is useful in the work model of a multi-step development process, as well as in production environments with higher security requirements regarding the viewing of the script code.


The functions of the script editor are disabled, but the code of the scripts can be viewed. This setting is recommended for the working model of a multi-level development process with a code management system and sync of the repos to the ScriptRunner server.


The functions of the script editor are restricted to the system directory _Upload_ on ScriptRunner Server. This setting is recommended for fast script prototyping. Administrators can use all functions of the Portal App for scripts restricted to this system folder. The other folders of the script library remain excluded and thus protected from changes.

The restricted mode is a very good combination of the advantages from both working models. Fast prototyping and testing in a one-step development process. Subsequent transfer of the prototype into the multi-stage work process using the code management system. The sync folders of the repos on ScriptRunner remain protected from changes past the code management.

Additional settings take effect when using the ON/restricted modes:

# Require a comment for every ScriptRunner script check-in
Set-AsrSettings -RequireScriptCheckinComment yes/no -restart
# Every script checked in from ScriptRunner is written
Set-AsrSettings -ArchiveScriptCheckIn yes/no -restart

Using Cmdlets from PowerShell Modules directly in Actions

In addition to PowerShell scripts, cmdlets from standard modules or custom-written PowerShell modules can be used directly in actions. The behavior of the input forms is determined by the exported cmdlet. In the script library, each cmdlet is displayed in the list of scripts and tagged with the module name.

A great advantage in direct use is when the respective cmdlet exactly maps the input and function requirements of the action. Also, in ScriptRunner, the cmdlet can be combined with queries.

Screenshot: List of ScriptRunnerSettings PowerShell module cmdlets in the Script Library.

List of cmdlets from the ScriptRunnerSettings PowerShell module

To add the cmdlets from modules to use directly:

# Add module cmdlets to ScriptRunner Script Library
Set-AsrPsModule -Module modulname -restart
# Remove module cmdlets to ScriptRunner Script Library
Remove-AsrPsModule -Module modulname OR -All -restart

The New Portal App “Scripts”

All new and old script library functions are bundled in the new Portal App for Scripts. It is accessed via the corresponding app tile in the Portal and first opens the familiar list of scripts in the library.

This app is only available for ScriptRunner users in the “Main Administrator” and “Administrator” role.

The search box in the top bar can be used to search for scripts and functions in full text. Clicking on one or more tags filters the view accordingly. The buttons for creating or adding scripts, also in the upper control bar, are only available in the script edit mode ON and Restricted.

The context menu at each entry in the list allows you to share the script for editing, view all PowerShell reports that generated executions of that script, and change ownership; only in the Main Admin role and using Team Repositories. See also the blog post on Version 2020R3.

Detail View and Integrated Script Editor

Clicking on a script switches to the detailed display. Under “General” the metadata for the script as well as data from the script header are displayed. The tab “Code” contains the integrated script editor. This can also be used in dark mode. The integrated editor displays the script code clearly and color-coded.
In script edit mode OFF this tab is switched off and is not displayed, in ViewOnly-mode the editing functions are switched off, the script code can be viewed.

Screenshot: Integrated Script Editor in Portal Edition R1

Integrated script editor in dark mode

Under the tab “Change history” you will find a list of all changes. Changes to the respective previous version can be displayed, and an older version can be restored. The restore is only available in script edit mode ON for all scipts or Restricted only for scripts in the system folder _Upload_.

Screenshot: Change history of a script in Portal Edition R1

Change history of a script

In script comparison display mode, the previous version is displayed on the left and the selected version of the script is displayed on the right, as is common in code management.

Screenshot: Script-Screenshot: Script comparison display mode in Portal Edition R1

In the script comparison display mode, two versions of a script can be displayed in parallel

In the “Used by” tab, an overview of the actions and script queries in which the selected script is used is displayed

Screenshot: Contents of the Used by tab in the Portal Edition R1 Script Editor.

Overview of the ScriptRunner actions in which the script Sum2Values.ps1 is used

Check-Out, Check-In and Revoke

In the script edit mode ON the functions for editing are available for all scripts, in Restricted only for scripts in the system folder _Upload_.


The script in question is checked out for editing on the code tab. Script editing is blocked for all other administrators. The script library list shows who has checked out the script. An editing copy is created on the ScriptRunner server. Configured actions will continue to use the last valid script from the library.


The edited script will be checked in after completion. An input prompt for additional history information is displayed (the settings can force an input). The editing lock is released and a new version of the script is used for newly started actions from this point on. The previous version of the script is stored in the history on the ScriptRunner server.


The editing of the script is discarded. The status of the script is reset. All changes in the script are lost.

Importing Scripts

The new import wizard is available for importing scripts. It is only available in the script edit mode ON or Restricted. In ON mode, scripts can be imported into all folders authorized for the administrator, in Restricted only into the system folder _UPLOAD_.

If roles of the type “Administrator” are used and team repositories have been set up on ScriptRunner, users with this role in script edit mode ON can only save to team repositories to which they have access rights. Users in the “Main Administrator” role can save to all folders in script edit mode ON.

The wizard starts when clicking the “Import script” button. In multi-team mode, the ownership for the script is set first. The selection depends on the role of the user. The ownership “Public” makes the script available for all administrators, otherwise only for restricted for members of the selected admin team.

Screenshot: Selection of scripts to import

Selection of scripts to import

Scripts can be selected for import via drag-and-drop. Selecting the script library folder assigns the location and automatically the default tags for this folder.

In script edit mode Restricted the folder selection is omitted, because all scripts are imported to _UPLOAD_. With the three directly selectable system tags, the usage type for the script can be specified.

Additionally, scripts can also be imported directly from ScriptRunner ActionPacks on GitHub. This feature is only available if there is an internet connection.

Screenshot: Detail view of the button for uploading scripts from ScriptRunner ActionPacks.

Button for uploading scripts from ScriptRunner ActionPacks

After clicking the button “ScriptRunner ActionPacks”, a dialog window pops up in which the desired script files can be selected and added directly to the selection list.

Screenshot: Dialog window for importing script files from ScriptRunner ActionPacks on GitHub

Selection of the desired script for import

In the final step of the wizard, all scripts are displayed in the script editor and changes can be made if needed.

Screenshot View of the imported scripts in the last step of the import wizard

In the last step of the import wizard, you can make changes to the scripts

After the import wizard is finished, the imported scripts are available for use in ScriptRunner as usual.

Creating Scripts from Templates

ScriptRunner now supports administrators developing scripts with provided templates. The template collection is continuously improved and extended.

The new Create Wizard is now available for creating scripts. This is only accessible in script edit mode ON or Restricted. In ON mode, newly created scripts can be saved in all folders authorized for the administrator, in Restricted only in the system folder _UPLOAD_.

If Administrator type roles are used and Team Repositories have been set up on ScriptRunner, users in this role can save in script edit mode ON only in Team Repositories to which they have access rights. Users in the Main Administrator role can save to all folders in script edit mode ON.

Create Wizard starts when you click the “Create new script” button. In multi-team mode, the ownership for the script is set first. The selection depends on the role of the user. The ownership “Public” makes the script available for all administrators, otherwise only restricted for members of the selected admin team.

Screenshot: Setting the script details

Definition of the script details

A new script can now be created. To do this, the file name for the new script must be specified. A file name may only exist once within the same folder.

The selection of the Script Library Folder assigns the storage location and automatically also the standard tags for this folder. In script edit mode Restricted the folder selection is omitted, because all scripts are stored in _UPLOAD_. With the three directly selectable system tags the usage type for the script can be further specified.

Screenshot: Script template selection

Selecting a script template

Templates can be selected from a dropdown menu. There, both no template (empty) or one of the displayed templates can be selected. This feature is only available if there is an internet connection.

In the last step of the wizard the new script based on the template is displayed in the script editor and can be edited directly.

Screenshot: Editing a script in the last step of the Create wizard.

In the last step of the create wizard, the script can be edited

After the wizard is finished, the script is available for use in ScriptRunner as usual.

New: Notification Center

The new Notification Center is a container for short-term system and error messages from processes that interact with the server in the background and are not related to direct, interactive input on the portal.
The information is browser session-bound and volatile. Access is via the icon in the top bar. After the notifications are displayed, the badge signaling new notifications is reset.

Screenshot: Opened Notification Center with active notification badge in the top bar

The Notification Center can be opened by clicking on the tray icon in the top bar

More Enhancements

New in the setup

In the update, the path to the complete transition to “Portal only” is demonstrated by the fact that the End User Self-Service Web App and the Delegate Web App can only be installed optionally and are “not selected” by default in the setup.

New in Portal App “Run”

A particularly interesting feature for users in the two administrator roles is the individual cancellation of running actions. This can be necessary if an action was started by mistake or if a PowerShell script does not finish running. Canceling an action is possible in the Action Runner as well as in the Report window.

Screenshot: Cancel button in Action Runner

Cancel Button in Action Runner

Screenshot: Cancel button in the report dialog

Cancel Button in Report Dialog

In the configuration for help desk and end users the display tabs of actions in the portal can now be configured and displayed.

The configuration is done via the context menu for the action on the tile or on the list item.
The administrator now has the possibility to see colors, icons, tabs and texts for the action as users in the help desk or end users would see them as well. If an action is configured with one or more display tabs, it will only appear on those tabs. Otherwise the action tags are used as tabs.

Screenshot: Actions in the list view

List of Actions

When an action is selected, the queries in the form can now be triggered using the Enter key in addition to clicking the search magnifying glass.

New in Portal App “Reports”

A new feature in the report filters is the “Clear all filters” function, which allows you to switch more quickly to the “Show all reports” state. In addition, the tooltips in the report display window have been expanded.

The new tab “Error messages” now shows separately occurred errors with hints, which arose during the execution of the action or script query. This tab is only available for users in the administrator roles.


Error message tab in the detail view of an action

New in Portal App “Authorize & Delegate”

When using the multi-team administrator model, all elements in ScriptRunner can be assigned under ownership to the respective administrator teams. In addition, a separate script repository can be set up for each administrator team.

To do this, a folder for each team repository must first be physically created in the root folder of the ScriptRunner library on the server. Then, a user in the Administrator role can assign the corresponding team repository folder to the team.

Screenshot: Zuweisung von Team Repositories

Assigning Team Repositories

PowerShell 7

With the lifecycle model for PowerShell 7, Microsoft has introduced a process with which PowerShell 7 is delivered as a runtime in products from other manufacturers.

To provide a stable basis for this, Microsoft marks certain releases with LTS (Long Term Support). The delivery version of ScriptRunner PowerShell 7 Host on ScriptRunner Server has been updated to the latest LTS 7.0.6.

The next major update of PowerShell 7 with LTS is announced for the end of 2021 with version 7.2. For more information, see the PowerShell Core support lifecycle article in the Microsoft documentation.

New in Queries

In the Admin App, when editing a cached query in the Cache Viewer, the entire cache can now be searched for expected elements. This is a significant improvement, especially for larger caches, as the previous limitation to the first 500 elements has been removed.

Screenshot: Cache Viewer in der ScriptRunner Admin App

Cache Viewer in the ScriptRunner Admin App

Sample Scripts for Application with the Web Service Connector

The sample scripts for using Web Service Connector have been removed from the delivery version. A new script has been developed which consolidates all variants for using the Web API to launch actions by third party systems.

The script is now in the ActionPack repository on GitHub: ScriptRunner Software on GitHub


scriptrunner-portal-edition-R1-403x403Try Portal Edition R1 now!

Discover the new features and benefits of automation and delegation with PowerShell!

Get your free trial



Related links

How to get started with automation in Jira

Heads up! ScriptRunner documentation is moving to Adaptavist will keep this site up for a bit, but no future updates to documentation will be published here. ScriptRunner 6.20.0 will be the last release to link to for in-app help.

ScriptRunner for JIRAScriptRunner for JIRA CloudEnhance and automate JIRA workflows, JQL functions, custom fields, listeners and more using GroovyEnhance and automate JIRA workflow post-functions, calculated fields and event handlers using Groovy ScriptRunner for JIRA provides administrators with an in-line editor where you can write groovy scripts. It also allows admins and power users to quickly extend JIRA functionality to support your business processes in your workflows, without the hassle of writing a fully-fledged Add-on. ScriptRunner for JIRA Cloud provides administrators with an in-line editor where you can write groovy scripts using JIRA Cloud. It also allows admins and power users to quickly extend JIRA functionality to support your business processes in your workflows by scripting the post functions, without the hassle of writing a fully-fledged Atlassian Connect Add-on. We provide a number of commonly used scripts out of the box or you can write your own to extend JIRA with scripted fields, tap into JIRA event handlers, listen for specified JQL queries and act on them automatically, enhance your reports with our extended JQL functions (like hasLinks, hasComments, hasAttachments or subTasksof). We provide a number of commonly used scripts out of the box or you can write your own to extend JIRA with scripted calculated fields, tap into JIRA event through script listeners. ScriptRunner for ConfluenceScriptRunner for Confluence CloudExtend Confluence menus, panels, macros and events using GroovyAutomate time-consuming admin tasks, customise the Confluence UI, and integrate Confluence with other apps ScriptRunner for Confluence provides administrators with an in-line editor where you can write groovy scripts. It also allows admins and power users to quickly extend Confluence functionality to support your company preferences, without the hassle of writing a fully-fledged add-on. ScriptRunner for Confluence Cloud offers admins the ability to automate, extend and customise Confluence Cloud with a wide range of built-in functionality and the ability to create their own automations using Groovy code. We provide a number of commonly used scripts out of the box to ease your project and repository administration or you can write your own to extend Confluence with scripted macros, tap into Confluence event handlers, listen for specified CQL queries and act on them automatically. Add new options to your Tools menu and customise your Confluence instance. Add your own pop-up AUI flags and dialogs, show conditional banner messages on certain spaces or to particular groups of users, include JavaScript and CSS in scripted contexts. Better manage Confluence content with automations (Built-in scripts) like bulk delete attachments, bulk delete comments, copy page tree, copy space and many more. Customise Confluence to meet the needs of your team by updating the UI and trigger automations from Confluence events with Script Listeners. ScriptRunner for Bitbucket ServerScriptRunner for BambooEnhance and automate Bitbucket Server (aka Stash) projects, repositories and Git workflows using GroovyAutomate and extend your CI and CD pipelines with the power of Groovy ScriptRunner for Bitbucket Server provides administrators with an in-line editor where you can write groovy scripts. It also allows admins and power users to quickly extend Bitbucket Server functionality to support your Git workflows, without the hassle of writing a fully-fledged Add-on. ScriptRunner for Bamboo provides administrators with an in-line editor where you can write groovy scripts. It also allows admins and power users to quickly extend Bamboo functionality, to help scale your continuous integration and delivery pipelines without the hassle of writing a fully-fledged Add-on.

Library scriptrunner

ScriptRunner and Scripting

NoSuchMethodError on some scripts/reports (PAS-10740)

This issue occurs due to a potential mismatch in the ant and ant-launcher jars. If you encounter a “NoSuchMethodError” when attempting to run a script or report, replace the ant-launcher jar file in the webapps directory with ant-launcher-1.8.3.jar.

Space in command-line argument to scriptRunner Scripts

Some users are reporting issues in running scriptRunner scripts if the command line argument to the script contains a space. This issue can be addressed by surrounding the line argument with single or double quotes.

For example, to pass the project name “My Project” to the exportWorkspaceData.groovy script, use the following commands:


./ -u myUser -c http://localhost:8888/palamida/ ../scripts/exportWorkspaceData.groovy -project 'My Project'


./scriptRunner.bat -u myUser -c http://localhost:8888/palamida/ ../scripts/exportWorkspaceData.groovy -project "My Project"

Changes to scriptRunner library jars causing issues for older scripts

Scripts that rely on older POI libraries may not work in this version of the product.

Workaround: Manually add the libraries to the /scriptRunner/lib directory, and modify scriptRunner.conf file to include the jars. As an alternative, modify the script for compatibility with POI 11.

How to get started with automation in Jira


Similar news:


3 4 5 6 7