Document toolboxDocument toolbox

(8.1.2) Total unresolved stories

Title

Total unresolved stories

Description

It returns the number of unresolved Stories

ObjectiveSee open stories in the project sheet
Audience
  • Scrum Masters
  • Dev Teams
  • Product Managers
  • Project Managers
  • Stakeholders
What does a Jira Project Represent?It represents Software that needs to pass thourgh every development phase, including QA 
Focus

Monitorization and quality assurance

Configuration

1. Create a Projectrak Script field called "Total unresolved stories". 

2. Insert the following Groovy script and modify accordingly to your instance:

Pre-requisites: N/A

Description: Returns the number of issues of type "Story" that are unresolved in the current project

Use in: It should be used as a Projectrak Script field

Variables in context: 

  • project [com.atlassian.jira.project.Project]: The current project 


ISSUE_TYPE_NAME: Line 9 in the script. In the example we are using Story. Please use the name of the issue type that you want counting.

Groovy Script

total-unresolved-stories.groovy
package deiser.profields.scripts

import com.atlassian.jira.bc.issue.search.SearchService
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.jql.builder.JqlQueryBuilder
import com.atlassian.jira.web.bean.PagerFilter

// Configuration
def ISSUE_TYPE_NAME = "Story"

// Components
def searchService = ComponentAccessor.getOSGiComponentInstanceOfType(SearchService.class)
def jiraAuthenticationContext = ComponentAccessor.jiraAuthenticationContext

// Script variables
def loggedInUser = jiraAuthenticationContext.getLoggedInUser()

// Make JQL query
def query = JqlQueryBuilder.newBuilder()
        .where()
        .project(project.id).and()
        .unresolved().and()
        .issueType(ISSUE_TYPE_NAME)
        .buildQuery()

// Returns the issue count
return searchService.search(loggedInUser, query, PagerFilter.unlimitedFilter).results.size()

3. Configure the project's layout including "Total unresolved stories".

4. Associate the Layout to the Software project you need this information to be applied to.

5. The result should be something like this: (please, keep in mind that this is only an example and your results should vary from what it is shown in the screenshot).