Skip to content
No description, website, or topics provided.
Branch: master
Clone or download
Latest commit 558d8b8 Oct 15, 2018
Type Name Latest commit message Commit time
Failed to load latest commit information.
JIRA JsIncluder add new methods Aug 14, 2018
JIRA groovy templates

Atlassian JIRA MyGroovy templates / examples

Template of quick writing groovy scripts for the plugin [Groovy Amigo] ( The template uses the usual java-api in easy-to-use wrappers. You can just to copy the code and apply it in the right order.

[Groovy language docs is here] (

Additions and wishes are welcome.

Example 1

Receiving issue


The template is represented by a method that is copied with the import.

	def getIssue(String key){

Example 2

Calling a transition at issue. The transition.groovy file contains the doTransition (issue, actionId, user) method. It passes the issue with which you want to call the transition, the transition id, user - the user on whose behalf the transition is made

	def doTransition(issue, int actionId, user){
	    def issueService = ComponentAccessor.getIssueService()
	    def issueInputParameters = issueService.newIssueInputParameters();
	    def transitionValidationResult = issueService.validateTransition(user,, actionId, issueInputParameters);
	    if (transitionValidationResult.isValid()){
	       issueService.transition(user, transitionValidationResult);
	        return true
	    } else {
	        return false

Example 3

To execute a query in the database, call the select ("select * from ...") method from the sql.groovy file

	select("select ...")

	def select(String query){
	    OfBizDelegator delegator = ComponentAccessor.getOfBizDelegator();
	    DelegatorInterface delegatorInterface = delegator.getDelegatorInterface();
	    String helperName = delegatorInterface.getGroupHelperName("default");
	    Connection connection = ConnectionFactory.getConnection(helperName);
	    Sql sql = new Sql(connection);
	    List<GroovyRowResult> resultRows = []
	    } finally {
	    return resultRows
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.