How to create a Jira custom field with options from an external REST API

To do this exercise, we will use the famous plugin for Jira called Adaptavist Scriptrunner. First step, we need to create a REST Endpoint in our Jira Server. This REST Endpoint will query the external REST API to obtain the values and options (In this example we will query GitHub to obtain a list of…

Read More

How to automate Jira Cloud backups using Windows

It’s very easy! First you need to install Python as admin in your Windows System. Go to the python.org website, select Download for Windows. Once installed, you must set the Python executables on the Windows System PATH environment variable. In “Control Panel “-> “System and Security” -> “System” click on “Advanced System Settings” Now click…

Read More

How to create a Jira Server script field to show in all parent ticket the SUM of some customfield of all subtasks

In this exercise we want to create a new custom field of type Scriptfield of Scriptrunner Jira plugin. This script field will sum all the values of some customfield of its subtasks. Just go to Add-ons –> Scriptrunner –> Script Fields and create a new Script field like this (Total…): Now place a script like…

Read More

How to read attributes from LDAP in Jira using Groovy

Example script code in Groovy to read attributes from persons of the LDAP in Jira Server or Datacenter by MrAddon @GrabResolver(name=’apache-snapshot’, root=’http://repository.apache.org/snapshots/’) @Grab(group=’org.apache.directory’, module=’groovyldap’, version=’0.1-SNAPSHOT’) import javax.naming.Context; import javax.naming.NameNotFoundException; import javax.naming.NamingEnumeration; import javax.naming.NamingException; import javax.naming.directory.Attribute; import javax.naming.directory.Attributes; import javax.naming.directory.BasicAttribute; import javax.naming.directory.BasicAttributes; import javax.naming.directory.ModificationItem; import javax.naming.directory.SearchControls; import javax.naming.directory.SearchResult; import javax.naming.ldap.InitialLdapContext; import javax.naming.ldap.LdapContext; import javax.naming.ldap.LdapName; import java.text.MessageFormat;…

Read More

ScriptRunner for Jira – Script Fields trick to use Common Classes

For a large scripts exist a trick to reduce the complexity of the Script Fields if you use classes that can be “common” and reused between other Script Fields. For example, imagine we want to create a Script field that show a report HTML inside the tickets with the Lean metrics. Something like this: And…

Read More

Create sub-task with specific label with Scriptrunner and Jira Server

Usually we want to create automatically subtasks in a transition and sometimes with a specific label. We use usually the plugin Adaptavist Scriptrunner in Jira Server to do tasks like this. Just creating a Postfunction in the Workflow. We can use the “Create Sub-task” script Postfunction with the usual parameters…   In the “additional issue…

Read More