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?
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 https://studio.plugins.atlassian.com/wiki/display/GRV/Scripted+JQL+Functions.
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.
Connect with like-minded Atlassian users at free events near you!Find a group
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no AUG chapters near you at the moment.Start an AUG
We're bringing product updates and pro tips on teamwork to ten cities around the world.Save your spot