Calculation Context Issue

I will be doing defect density, as part of this exercise calculating #of defects/ #of story points for each phases.

Problem is I do not have story points captured in all the defects which was created in Jira. So wherever there is no story points I will be assuming 2 story points be default.

My expected report structure is like this. With Project and Sprint as page filter

Phase Detected #of Defects Story Points Defect Density%
All Phases 17 47 36%
SIT 10 25 40%
UAT 7 22 31.8%

There is a possibility under SIT phase 5 defects are defined 3 story points each and remaining 5 defects there is no story points defined in Jira. So instead of blank I will be assuming 2 story points for each defects total will be

10 story points (52) + already 15 story points defined for 5 stories (53) as combined = 25 .

Values which I am getting

Phase Detected #of Defects Story Points Defect Density%
All Phases 17 27 63%
SIT 10 15 67%
UAT 7 22 31.8%

I can see this in context issue, but I’m not sure how to resolve this.

ASK: How to write formula to satisfy my requirement.

Hi,

Here you could try using a custom Javascript code in import options page to manually import 2 Story points for issues without story points.
Just make sure that you use your Story point custom field ID instead of NNNNN

if(issue.fields.customfield_NNNNN == null){
      issue.fields.customfield_NNNNN = 2
    }

see more about custom fields here:

Martins / eazyBI support