IMPROVEKIT

Script Ruby for Jira

 

Stand-alone version for Jira server and Jira Cloud

 

You can BUY this product here

 

Basically this version has the same features as the plugin for Jira Server (see below) but allows to run it as a Ruby script

Installation

  • Unzip the file

  • Install last version of Ruby in your system . Example on MacOs:

brew install ruby-install ruby-install --latest brew install ruby-3.2.1 brew install ruby@3.1 echo 'export PATH="/usr/local/opt/ruby@3.1/bin:$PATH"' >> ~/.profile ruby -v
  • Install jira-ruby gem

cd jira-ruby-master sudo gem install nokogiri -- --use-system-libraries --with-xml2-include=/usr/include/libxml2 --with-xml2-lib=/usr/lib/ bundle install sudo gem install jira-ruby

 

See options

ruby rql2.rb --help Usage: rql.rb options -j JQL Jira jql code to retrieve issues - REQUIRED -f fields field list for jql -x expand expand list (all,project,issuetype,users,components,versions,comment,issuelinks,worklog,attachment,subtasks,customs) -q rql Improvekit ruby query language (rql) code to process jql result -F include extra (calculated) fields -n integer number of fields to generate for collection values fields (defaults apply) -N integer max number of rows to query -s fileName name of rql script file -d dirName full path name of scripts (by default current dir) -h host Jira host name -u user Jira user name -p passw Jira user password -c clear caches -T trial (for testing) -v verbose --help Ruby Query Language commands: select :all :fieldI, ... lambdaI | :field1 | lambda1 => :alias1, ... , fieldN | lambdaN => aliasN where field | lambda or where field | lambda => value Examples: where :createdYesterday or where :created => Date.yesterday or where lambda { |r| r.before? :created, Date.today } sort_by | order_by :field1, ... , fieldN [descending = false] group_by :field1 => :alias1, ... , fieldN => aliasN | lambdaN => :aliasN Example: data.group_by :project => :prj, lambda { |group| group.size} => :count where_ranked field, rankedByField, number Example: data.where_ranked :type, :items, 5 omit_all | omit field distinct field values_of field result set protocol: join set [fields = nil]. Example: activities.join group, [:project, :period, :type]. result.join set, indexed_on set indexed_on field. Example: index = data.indexed_on: [:project, lambda {:row | row quarterly}, :type ] exists? another_set num field statistics: sum, average, accum_sum, accum_average, max, min, median, mode, variance, standard_deviation buckets, centiles, quartiles, ranks row protocol: join row, in field, values, accum_sum field, scalar is_null? field, is_nothing? field, is_zero? num_field, is_today? date_field equal_to? field, after? field,value, before? field, value, between field,value

Run

Result are answered in json format

 

Jira Server plugin Version

This plugin allows you to obtain information from the Jira through queries written in a specific domain language called (RQL). The language is based on Ruby, with semantics similar to the well-known SQL to facilitate learning. The plugin is used as one more service available within your Jira server, from your own scripts and / or applications.

 

Support

If you need support on the plugin, please send an email to improvekit@gmail.com and your order will receive a response and solution. Improvekit is formed by specialists in systems with more than 20 years of experience in software engineering and in Jira's employment every day and develops its applications following a mature methodology to provide its clients with the highest quality and service

Features

  • Integrated with JQL

  • Domain Specific Language (RQL)

  • Caching of queries

  • Control over the fields and expansion of objects (such as projects, components, versions, comments)

  • Control over collection fields, selected in individual columns by value (you can indicate up to how many columns)

  • Limit the number of records returned

  • Supports custom fields

  • Supports script files

 

Services

Base Url

jira-server-url/plugins/servlet/rql

Format

REST/json

Method

POST

Check License

 

Commands

Send as request parameters

 

Parameter

Argument

Description

Parameter

Argument

Description

clear

 

Reset the plugin and clear caches. The clear command does not need to have established the session with login

expand

list of objects/attributes to expand

Answer additional expanded object attributes. Available expands includes:

  • project

  • issuetype

  • users

  • components

  • versions

  • comment

  • issuelinks

  • attachment

  • subtasks

extras

 

Also answer a set of predefined calculated fields and expands:

  • created_age

  • updated_age

  • duration

  • duedates history

  • estimates history

  • versions_changes

  • worklogs

fields

field names list

Also retrieve these fields from Jira. For all fields, specify *all

filename

script_file_name

The filename that contains RQL query code

jql

jql code

Main query to obtain data from Jira. Allways given, except for clear and verbose commands. Query results are cached (see also clear command)

login

 

Set credentials with Jira (use cookies)

number_of_fields

number

For collection fields, max number of columns to answer with each value (defaults apply)

rows_limit

number

Max number of rows to retrieve with JQL

rql

rql code

Optional. This domain specific language query is processed over the data obtained with jql. See below for a language sintax and available commands

scripts_dir

full-path-to-my-scripts-on-server

By default, jira-home/scripts/rql. See also filename

verbose

 

Record process steps and information in Jira log (including Jira available field names)

 

Ruby Query Language commands

 

The JQL result data is available in a ResultSet class variable called data. Ruby syntax apply.


select :all | :field, ... lambdaI | :field1 | lambda1 => :alias1, ... , fieldN | lambdaN => aliasN

where field | lambda or where field | lambda => value
Examples:

sort_by | order_by :field1, ... , fieldN [descending = false]

group_by :field1 => :alias1, ... , fieldN => aliasN | lambdaN => :aliasN

where_ranked field, rankedByField, number

omit_all | omit field

distinct field

values_of field

Result Set Protocol


join set [fields = nil].

indexed_on field.

exists? another_set

Available numeric field statistic functions

sum, average, accum_sum, accum_average, max, min, median, mode, variance, standard_deviation, buckets, centiles, quartiles, ranks

Row protocol

join row

in field, values

accum_sum field

scalar

is_null? field

is_nothing? field

is_zero? num_field

is_today? date_field

equal_to? field

after? field, value

before? field, value

between field,value

 

Examples

Below are a series of service requests to the plugin using the command line (curl)

clear

The value of the clear parameter could be any value, if the clear parameter is provided the plugin is assumed as yes

clear verbosed

login

query mixing JQL and RQL

selected collection fields

where (you cloud use closures, see next example)

selected, extra and expanded fields

closures (lambda)

group_by, ranks and transpose

script file using an index

rql_example.rb:

 

 

Privacy Policy

Data security and privacy policy

 

End User License Agreement

EULA


Support

If you need support on the plugin, please send an email to improvekit@gmail.com and your order will receive a response and solution. Improvekit is formed by specialists in systems with more than 20 years of experience in software engineering and in Jira's employment every day and develops its applications following a mature methodology to provide its clients with the highest quality and services.

Contact improvekit@gmail.com