Can I calculate a percentage of (total time under specific status) based on specific calendar

Aya AlJboor March 21, 2023

I would like to find a plugin that would give the ability to generate the following:

  1. Calculate the time taken from creating the issue until resolution (as total downtime) for each issue.
  2. A report to Calculate the total downtime in minutes, the summation is grouped by a field in the issue-level
  3. a percentage of downtime per month based on the following formula: downtime (calculated in point 2)/(24*60*30)

 

I found a plugin that could do the first two points but facing some issues in the last point!

1 answer

0 votes
Oday Rafeh
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 21, 2023

Hi @Aya AlJboor 

You can use a combination of Jira built-in features and plugins. I'll suggest a solution for the third point using ScriptRunner for Jira.

Please use this script in your script field: 

import com.atlassian.jira.component.ComponentAccessor

def issueManager = ComponentAccessor.getIssueManager()

// Retrieve the custom field holding downtime in minutes
def downtimeField = ComponentAccessor.getCustomFieldManager().getCustomFieldObjectByName("Downtime in Minutes")
def downtimeInMinutes = issue.getCustomFieldValue(downtimeField) as Double

if (downtimeInMinutes == null) {
return null
}

// Calculate downtime percentage based on the formula provided
double totalTimeInMonth = 24 * 60 * 7 * 30
double downtimePercentage = (downtimeInMinutes / totalTimeInMonth) * 100

return downtimePercentage

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
TAGS
AUG Leaders

Atlassian Community Events