Document toolboxDocument toolbox

(8.7.0) Number of blocking bugs in QA status

Title

Number of blocking bugs QA status

Description

Returns the total of bugs with Block priority in QA status

ObjectiveComunicate how many blocking bugs your project has
Audience
  • Project leads
  • Dev Teams
  • QA Teams
What does a Jira Project Represent?It represents Software that needs to pass through every development phase, including QA 
Focus

Monitorization and quality assurance

Configuration

1. Create a Projectrak Script field called "Blocking Bugs in QA"

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

Pre-requisites: N/A

Description: Returns the number of issue with type Bug, Blocker priority and in QA Status 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 


Priority: Line 20 in the script. In the example we are using Blocker. Please use the status the would represent that phase in your instance.

Status: Line 21 in the script. In this example we are using QA. Please use the status the would represent that phase in your instance.


Groovy Script

blocking-bugs-in-qa.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


// 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()
        .priority("Blocker").and()
        .status("QA")
        .buildQuery()

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

3. Configure the project's layout including "Blocking Bugs in QA" 

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).