Agregate Expression on Dashboard

Script Runner add-on for JIRA provides experimental feature Aggregate Expression -

I am curious if those results can be somehow embedded on a JIRA dashboard.

1 answer

1 accepted

There is a REST Endpoint ( rest/scriptrunner-jira/latest/jqlfunctions/aggregateResult ) built into ScriptRunner that returns the results of the aggregateExpression function. You could send a GET request to it by fetching the a URL like the following, where the jql query parameter is a URL encoded JQL statment using aggregateExpression: <your-jira-instance-base-url>/rest/scriptrunner-jira/latest/jqlfunctions/aggregateResult?jql=project%3DPROJ+and+issueFunction+in+aggregateExpression("Expr"%2C+"timespent.sum()") 

The above is equivalent to this JQL:

project=PROJ and issueFunction in aggregateExpression("Expr", "timespent.sum()")

Getting that content into a Dasbhoard is a little trickier.

One path would be to use a Dashboard gadget that could take the output and display it. You could use something free like the Universal Gadget for JIRA plugin, or write your own gadget

Another path would be to wire the results into the UI using Javascript by way of a ScriptRunner UI customization. You'd most likely need to write some JavaScript (probably saved in your script roots as a web resource). That's likely to be pretty involved, and to require a fair bit of knowledge about front-end web development.

Of note, we have a request in our backlog (SRJIRA-2104) to add Scripted Dashboard gadgets to ScriptRunner, which would constitute a third way. That said, it's not on the immediate roadmap for SR for JIRA.

Good point, thanks for advice.

Suggest an answer

Log in or Join to answer
Community showcase
Teodora [Botron]
Published Thursday in Marketplace Apps

Jira Inferno: The Nine Circles of Jira Administration Hell

If you spend enough time as a Jira admin - whether you are managing a single, mid-sized instance, a large enterprise one or juggling multiple instances at once - you will eventually find yourself in ...

683 views 4 16
Read article

Atlassian User Groups

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!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot