cogShows different solutions to access JIRA from an XWiki instance
Developed by

Vincent Massol

0 Votes
LicenseGNU Lesser General Public License 2.1


There are several solutions to access data from your online JIRA server:

In addition to this you can simply use JIRA's RSS URLs as demonstrated below. Also make sure to check out the JIRA Macro which uses the JIRA RSS URLs.

If all you need is query the JIRA server using the JIRA's RSS URLs is by far the best method (it's also the more performant one). On the other hand if you need to make modifications to JIRA then you should use one of the other methods.


Displays the summary of an issue

def url = "".toURL().text
def root = new XmlSlurper().parseText(url)

println "${}"

Displays the content of a list of issues

def jql = URLEncoder.encode("issueKey=XWIKI-1000 OR issueKey=XWIKI-1001", "UTF-8")
def columns = "field=type&field=key&field=summary&field=assignee&field=status&field=link"

def url = "${jql}&${columns}".toURL().text
def root = new XmlSlurper().parseText(url)

println "|=Type|=Id|=Summary|=Assignee|=Status" {
    println "|[[image:${[email protected]}]]|[[${it.key}>>${}]]|${it.summary}|${it.assignee}|[[image:${[email protected]}]]"



Computes total time spent

import groovy.json.*

def jql = "project = NUMPORTAL AND component = 17-002 AND component = 'Out of Scope'"
def url = "${}&os_username=<usernamehere>&os_password=<userpasswordhere>&os_authType=basic&field=timespent".toURL().text
def root = new JsonSlurper().parseText(url)

int totalTimespent = 0
root.issues.each() { issue ->
  def spent = issue.fields.timespent
 if (spent) {
    totalTimespent += spent
println "Total time spent = ${totalTimespent} seconds"
Tags: jira REST

Get Connected