• Stars
    star
    106
  • Rank 313,875 (Top 7 %)
  • Language
    Groovy
  • Created about 7 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Atlassian JIRA MyGroovy templates / examples

Template of quick writing groovy scripts for the plugin [Groovy Amigo] (https://marketplace.atlassian.com/1218755). 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] (http://groovy-lang.org/documentation.html)

[MyGroovy source code] (https://github.com/atlascommunity/jira-plugins-groovy)

[MyGroovy documentation] (https://github.com/atlascommunity/jira-plugins-groovy/wiki)

Additions and wishes are welcome.

Example 1

Receiving issue

	ComponentAccessor.issueManager.getIssueObject(key)

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

	def getIssue(String key){
		ComponentAccessor.issueManager.getIssueObject(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, issue.id, 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 = []
	    try{
	        resultRows.addAll(sql.rows(query));
	    } finally {
	        connection.close()
	    }
	    return resultRows
	}

More Repositories

1

easyjson

Fast JSON serializer for golang.
Go
4,287
star
2

FileAPI

FileAPI — a set of javascript tools for working with files. Multiupload, drag'n'drop and chunked file upload. Images: crop, resize and auto orientation by EXIF.
JavaScript
3,579
star
3

easygo

Tools for building go apps.
Go
655
star
4

icqdesktop.deprecated

C++
447
star
5

go-clickhouse

Golang SQL database driver for Yandex ClickHouse
Go
412
star
6

dbr

Additions to Go's database/sql for super fast performance and convenience. (fork of gocraft/dbr)
Go
173
star
7

graphite-nginx-module

An nginx module for collecting stats into Graphite
C
135
star
8

fest

javascript templates
JavaScript
127
star
9

tntlua

Tarantool 1.5 Lua stored procedures
Lua
82
star
10

tarantool-authman

Lua
53
star
11

surgemq

Go
19
star
12

jira-plugins-jsincluder

JavaScript
16
star
13

shadowplay

Rust
15
star
14

designsystemsclub

Каталог отечественных компонентных дизайн-систем, реализованных на технологическом уровне. Живые гайдлайны, статьи, презентации, выступления и другие материалы о них.
CSS
14
star
15

jira-plugins-mrimsender

Mail.Ru Agent Notifications JIRA Plugin
Java
13
star
16

sumbur-ruby

sumbur-ruby
Java
12
star
17

ipro-cli

iproto cli tools
C
12
star
18

March

Kotlin
11
star
19

activerecord

Go
10
star
20

confetti

confetti - configuration file parser generator
C
10
star
21

mail-auth-sdk-android

Java
9
star
22

opensource.mail.ru

opensource.mail.ru wiki content
HTML
9
star
23

nocaptcha-php

PHP
8
star
24

imaginelua

Lua
6
star
25

slick-migration

Slick-migration - is a Scala library that helps to maintain compilable migration scripts
Scala
5
star
26

top-mail-ru

PHP
5
star
27

hit-doc

PHP
5
star
28

libzxcvbn

Simple implementation of zxcvbn in C
C
4
star
29

queue-processor

PHP queues processing tool
PHP
4
star
30

inetnums

Python
4
star
31

jira-plugins-commons

Dependency module
Java
4
star
32

nocaptcha-bitrix

CMS Bitrix module for working with Nocaptcha Mail.Ru service
PHP
4
star
33

iproto-ruby

Ruby implementation of Mail.Ru iproto protocol
Ruby
3
star
34

confluence-plugins-utils

Java
3
star
35

mrasender

Tarantool module for sending messages to Mail.Ru Agent
C
3
star
36

nocaptcha-perl

Perl module for working with Nocaptcha Mail.Ru service
Perl
3
star
37

bamboo-plugins-utils

Utils for Bamboo
Java
2
star
38

nocaptcha-python

Python
2
star
39

mail-auth-sdk-ios

Objective-C
2
star
40

VK-Jira-Plugins

1
star
41

wdio-redirect-by-pattern-service

TypeScript
1
star
42

quotas

Lua
1
star
43

2kit

1
star
44

skill_cosmo_quest

Python
1
star
45

tslint-2kit-rules

1
star
46

nocaptcha-wordpress

WordPress module for working with Nocaptcha Mail.Ru service
PHP
1
star
47

clearnet

Kotlin
1
star
48

activerecord-cookbook

Go
1
star