IMPROVEKIT

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this content. View the current version.

Compare with Current View Version History

« Previous Version 54 Next »

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

Version for Jira cloud

You can request a ready and fully functional solution for Jira Cloud based on Ruby that uses JIRA REST Cloud. Send an email to improvekit@gmail.com and we will contact you

Services

Base Url

jira-server-url/plugins/servlet/rql

Format

REST/json

Method

POST

Check License

$ curl -uuser:passw http://jira-url/plugins/servlet/rql/license

Commands

Send as request parameters

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:

data.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

data.group_by :project => :prj, lambda { |group| group.size} => :count

where_ranked field, rankedByField, number

data.where_ranked :type, :items, 5

omit_all | omit field

distinct field

values_of field

Result Set Protocol


join set [fields = nil].

activities.join group, [:project, :period, :type]

result.join set, indexed_on set

indexed_on field.

index = data.indexed_on: [:project, lambda {:row | row quarterly}, :type ]

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

curl -uuser:passw -X POST http://jira-url/plugins/servlet/rql?clear=yes

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

clear verbosed

curl -uuser:passw -X POST http://jira-url/plugins/servlet/rql?"clear=-c&verbose=-v"

login

curl -uuser:passw -X POST http://jira-url/plugins/servlet/rql?login -c session

query mixing JQL and RQL

curl -X POST http://jira-url/plugins/servlet/rql -b session -d "\
    verbose=-v& \
    jql=project=RQL& \    
    rql=data.distinct :project"

selected collection fields

curl -X POST http://jira-url/plugins/servlet/rql -b session -d "verbose=yes&jql=project=RQL&fields=components,fixVersions"

where (you cloud use closures, see next example)

curl -X POST http://jira-url/plugins/servlet/rql -b session -d "verbose=-v&\
  jql=project=RQL&\
  rql=data.where :resolution => 'Done'"

selected, extra and expanded fields

curl -X POST http://jira-url/plugins/servlet/rql -b session -d "verbose=yes&\
  jql=project=RQL&\
  fields=issuetype,project&\
  extras=-yes&\
  expand=versions,components,issuelinks&\
  rql=data.where lambda { |row| row.before? :worklogs1_started, Date.new }"

closures (lambda)

curl -X POST http://jira-url/pluginsservlet/rql -b session -d "verbose=-v&\
	jql=project=RQL&\
	fields=issuetype,project&\
	expand=versions&\
	rql=data.group_by :project => :p, :versions1_name => :v,\
	 lambda {|group| (group.distinct :issuetype).values.join('~')} => :instruments,\
	 lambda {|group| group.size} => :items"

group_by, ranks and transpose

curl -X POST http://jira-url/plugins/servlet/rql -b session -d "verbose=-v&jql=project=RQL&password=passw&rql=\
((data.group_by :project => :project, :issuetype => :type, lambda {|r| r.size } => :value)\
    .where_ranked :type, :value, 5)\
    .transposed_sum :type"

script file using an index

curl -X POST http://jira-url/plugins/servlet/rql -b session -d "jql=project=RQL&filename=rql_example.rb"

rql_example.rb:

activities = (ranks = ((data.group_by :project, :issuetype, lambda {|r| Date.parse(r.created).quarter} => :quarter)
  .select :project, :issuetype, :quarter,
      lambda {|group| group.size} => :items)
      .where_ranked :issuetype, :items, 5).indexed_on [:project, :quarter, :issuetype] 

periods = data.group_by :project, :issuetype, lambda {|row| Date.parse(row.created).quarter} => :period

rows = (periods.group_by :project, :issuetype => :type, :period => :period, lambda {|group| group.size} => :total)
  .select :project, :period, :type,
      lambda {|group| 
        row = activities.join group, [:project, :period, :type]
        row.items unless row.nil? } => :items,
      :total => :total

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.

  • No labels