It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Script Runner Script JIRA Integration Options

I have written my first Groovy script in the JIRA Script Runner. The purpose of the script is to output a filter-style report that I cannot replicate with JQL. Also, since the REST API seems to depend on JQL queries, I am not certain I can get the results of my query from an external Java application using the REST API. I have written the script using an SQL query and using the JIRA API classes.

I must use the script approach since I cannot set up a development project due to the environment and maven dependencies. I have executed the script in the Script Runner and the output is displayed at the top of the Script Runner Page.

Ideally, I would like to invoke the script from within the JIRA application - either from a button or link - preferrably from the Issue Navigator page. Also, all of the Script Runner examples I have found always output a String which is then displayed on the Script Runner page. I would like to generate a more attractive output. The target output is a hiearchical representation of most of the field data for issues / subtasks objects.

Can anyone recommend the best JIRA intergration strategy and user-friendly output options using the Groovy Script Runner?

1 answer

Hrmmmm.... the main purpose of the script console (ie Admin -> Script Console) is for a) prototyping and testing and b) for admins to run administrative scripts, eg housekeeping.

As such it does not really offer much. Also note you need to be a global admin to run any script there.

You can build html in your script using eg HtmlBuilder and return that, but as I say, this is not the best choice.

A custom report sounds your best bet, but script runner does not offer any extension points for writing reports at the moment.

If your script returns a list of issues, imho the best thing to do is to write a JQL script - see

If not then you may have to write your own plugin to get the output you need...

Thank you. I have been looking at the Scripted JQL examples, in particular the RelationsOfMatchingQuery. My minimum requirement is to output, on a single line, parentissueid, parent summary, subtaskissueid, subtask summary, in addition to other duplicated fields such as status.

It is possible to extend the RelationsOfMatchingQuery to output both the parent and sub-task fields? I think it is, but I am not certain of the proper API calls (newbie to JIRA API and concepts) and how to insure all the parent / subtask items are in the result display.

I can execute the following JQL - issueFunction in parentsOf("issuetype = Sub-task") - in the Advanced screen, on which I have added the field "Sub-tasks" from column configurator. But this does not meet the requirement. I agree that a plugin is what is best, but due to security policies it is not feasible from a network perspective and without a maven repository available.

Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Marketplace Apps & Integrations

Expose your beautifully crafted Dashboard through the Jira Service Desk Customer Portal

  A picture is worth a thousand words, especially when you're trying to find relationships and understand your data. Here, Dashboards play a vital role in gaining insights from a variety of dat...

314 views 5 4
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you