We are in “migrations” times, and this script probably will be useful to “repeat” failed “Project Importations” in Jira Server & Datacenter. To reset Versions & Components in a target project we can use a script in Groovy for Scriptrunner in order to run it in the Script Console. IMPORTANT: Remember to change the Key…
Read MoreREST Endpoint to RESET CAPTCHA of users in Jira Server using Scriptrunner
A simple example code: function CaptchaReset(username) Example query: /rest/scriptrunner/latest/custom/CaptchaReset?username=mraddon Example result: {“result”:”OK”} By MrAddon
Read More“Review” issues from “filter results” Jira Dashboard gadget
Sometimes we need to transition issues (or “review” issues) from our usual Dashboard Jira gadget “filter results” with only one click. For this “trick” we need the plugin Scriptrunner for Jira. First create a custom REST Endpoint with Scriptrunner to Transition the issues (and do more actions if they needed). Example code: Note: the name…
Read More¿How to store and access configuration data in Jira for Groovy Scripts?
1. Place a file with name credentials.properties Under <script_root> : app.url=http://example.com app.user=myuser app.password=secret 2. Create an Accessor class in <script_root>/mycompany/MyCompanyProperties.groovy: package mycompany import com.onresolve.scriptrunner.runner.ScriptRunner import com.onresolve.scriptrunner.runner.ScriptRunnerImpl import java.nio.file.Files import java.io.File import groovy.util.logging.Log4j @Singleton @Log4j public class MyCompanyProperties { final String configFileName = ‘credentials.properties’ public Properties getProperties() { def scriptRoots = ScriptRunnerImpl.getPluginComponent(ScriptRunner).getRootsForDisplay()?.split(“, “)?.toList()…
Read MoreExample of Jira REST Endpoint with Groovy and using the user session
A simple example code: function getCurrentUser(issueId) Example query: /rest/scriptrunner/latest/custom/getCurrentUser?issueId=KEY-111 Example result: {“currentUser”:”rpelaez”,”issueId”:”KEY-111″} By MrAddon .
Read MoreExample of Dialogs with Jira and Scriptrunner
In this example we will create a new Dialog inside Jira using Scriptrunner, a little bit of HTML, Groovy and Javascript. First we will create 2 REST Endpoints (one to show the Dialog and another one to show a HTML page with the results of the action). Custom REST EndPoint: showDialogExample (example code extracted from…
Read MoreHow to create scheduled alerts from Jira to Slack channels
In this exercise, we will use a sample code of Adaptavist library in order to create a new “Escalation Service” in Jira (using the plugin Scriptrunner for Jira) to create scheduled alerts from a Jira JQL query to a Slack channel (using a Webhook). (click here to see the sample code) As first step, go…
Read MoreJIRA Scriptrunner REST Endpoint to Clone project
First of all, please remember How to create and invoke a new REST Endpoint in Jira: JIRA Scriptrunner REST Endpoint & Web Fragment example In this exercise we will create a REST Endpoint in our Jira using Scriptrunner plugin to clone an existing project. The REST endpoint in this case accept two params: project_key and…
Read MorePredictable dropdown fields in Jira with Scriptrunner
This exercise is the continuation of: How to create a Jira custom field with options from an external REST API In this case, instead of use an external REST API to obtain the values of the dropdown, we want to use a static list of values. We will use the same approach than the other…
Read MoreCurso de desarrollo Groovy para Jira Server
Objetivos En el curso instalaremos Jira Server y Adaptavist Scriptrunner (antiguamente conocido como Groovy Scriptrunner). Explicaremos: Script fields, Script Postfunctions, Script Conditions, Script listeners, Script services, Escalation services, jql custom functions, Behaviours, built-in scripts y web fragments & custom REST endpoints. Daremos ejemplos y casos de uso, haremos ejercicios prácticos y explicaremos alternativas a Scriptrunner…
Read MoreHow to install a PHP JIRA REST API Client
In this example, we will try to install in 5 minutes a PHP Jira Client script in a MacOS system. The prerequisites are: (Homebrew) brew for MacOS CURL for MacOS PHP 7 for MacOS Composer for MacOS php-jira-rest-client library Install instructions with example: Download and Install PHP Composer. curl -sS https://getcomposer.org/installer | php Next, run…
Read More