Skip to content

star7js/scriptrunner-samples

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ScriptRunner Samples

This repository provides sample ScriptRunner plugins for Atlassian products (Jira, Confluence, and Bitbucket). These samples demonstrate how to create custom scripts that extend Atlassian product functionality using Groovy.

Repository Structure

├── jira/           - Jira ScriptRunner samples (Event Listeners, REST endpoints)
├── confluence/     - Confluence ScriptRunner samples (CQL functions, Search fields, REST endpoints)
└── bitbucket/      - Bitbucket ScriptRunner samples (Pre-receive hooks, REST endpoints)

Prerequisites

Before you start, you'll need:

  1. Atlassian SDK - Install following the Atlassian SDK documentation
  2. Java 17 - Required for Jira 10.3+ (Java 8 and 11 are not supported)
  3. Maven (comes with the Atlassian SDK)

Quick Start

Build the plugins

Build all modules:

atlas-mvn clean install

Build a specific product module:

cd jira
atlas-mvn clean install

Run with Atlassian Products

Start Jira with the plugin installed:

cd jira
atlas-mvn jira:debug -U

Start Confluence with the plugin installed:

cd confluence
atlas-mvn confluence:debug -U

The Atlassian product will start on http://localhost:2990/jira or http://localhost:1990/confluence with default credentials admin/admin.

Note: Bitbucket requires additional git server/sidecar setup to run locally.

Run Tests

Run integration tests for a module:

cd jira
atlas-mvn integration-test

Run a specific test:

cd jira
atlas-mvn integration-test -Dit.test=CustomEventListenerIT

Sample Scripts Included

Each module contains example scripts demonstrating common ScriptRunner patterns:

  • Event Listeners - React to product events (project creation, page updates, etc.)
  • REST Endpoints - Create custom REST APIs
  • Hooks (Bitbucket) - Validate commits before acceptance
  • CQL Functions (Confluence) - Extend Confluence Query Language
  • Search Fields (Confluence) - Add custom searchable fields

Documentation

For more details see:

Troubleshooting

Parent POM Resolution Issues

This repository is configured to use version 89 of the scriptrunner-*-standard parent POMs, which is known to work with the Adaptavist Nexus repository at https://nexus.adaptavist.net.

If you encounter issues:

  • Master branch uses version 90, which may have dependency resolution problems
  • The bugfix/listener-registration branch uses version 34 with https://nexus.adaptavist.com (different URL)
  • Several experimental branches exist with alternative configurations

Experimental Branches

The repository contains several branches with alternative approaches:

  • bugfix/listener-registration - Simplified setup with older, stable versions (parent POM 34, Jira 8.13, Confluence 7.13, Bitbucket 7.17)
  • feature/test-service-implementation - Jira 11 compatibility using JAR packaging instead of atlassian-plugin
  • task/platform-7-compatibility - Platform 7 specific updates

These branches may provide working reference implementations if you encounter issues with the current setup.

About

Updated version of Dev Environment for Jira Scriptrunner Data Center

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 15

Languages