Heads up! ScriptRunner documentation is moving to docs.adaptavist.com. Adaptavist will keep this site up for a bit, but no future updates to documentation will be published here. ScriptRunner 6.20.0 will be the last release to link to scriptrunner.adaptavist.com for in-app help.

The Virtual Tour Server Team would like to audit their current workload to find out how many weeks of effort remain on a set of stories. By using the aggregateExpression JQL and creating a filter, the project manager can see at an instant the data and make an informed decision about their next steps.

In order to get results in this exercise, you need to enter a few time entries / remaining estimates into issues in your project.
  1. Open a new search by clicking Issues > Search for Issues.

  2. If you’re not in Advanced search mode already, click Advanced.

  3. Write a JQL thread to identify the issues you’d like to see remaining work on: e.g. project=DPS AND Issuetype=story

  4. Add AND issueFunction in aggregateExpression("Remaining work for all Issues", "remainingestimate.sum()") to the thread and run the search.

  5. Optionally, save this as a filter to use again later, or in other functions in Jira. The aggregateExpression JQL function calculates all of the remaining time estimates on the issues in the query and displays them in an info box. This info box appears below the search field with the results of the query, and can be used again if saved as a filter. In our example, it shows that there are eight weeks and one day left of work. The results of the aggregateExpression are a snapshot and will change as issues are updated.

You cannot export the results of the calculation because the number from the info box isn’t saved anywhere. Rather, this calculation is displayed when the search is run. If you want to perform calculations on information that is in Jira and then create exportable reports, you could create script fields for those calculations. This will require some Groovy code, and the Adaptavist library has few recipes you could use as a starting point.

Have questions? Visit the Atlassian Community to connect, share, and learn with other Atlassian users and experts, including Adaptavist staff.

Ask a question about ScriptRunner for JIRA, Bitbucket Server, or Confluence.

Want to learn more? Check out courses on Adaptavist Learn, an online platform to onboard and train new users for Atlassian solutions.