eazyBI - How to set a date difference based on a custom field, not JIRA's Resolved system field

Peter Bengov Community Champion Jan 05, 2015

This is the code I'm using for calculating the median

Median(
  Filter(
    NonEmptyCrossJoin(
        Descendants([Issue].CurrentMember, [Issue].[Issue]), [Measures].DefaultMember),
        [Measures].[Issues resolved] > 0
    ),
  DateDiffHours([Issue].get('Created at'),
    [Issue].get('Resolved at'))
)

I'm looking to use a custom date field I have instead of the "Resolved" field. However, 2 issues with that:

  1. The custom field is a date field (doesn't save the hour).
  2. How do I change this piece of code to make this new field replace the system one.

Thanks

2 answers

1 accepted

This widget could not be displayed.

Hi Peter!

The formula above is looking only at resolved issues (the filter with [Measures].[Issues resolved] > 0), but I imagine you would like to go through all issues no matter if they are resolved or not. In this case you would use the [Measures].[Issues created] > 0 instead.

If the custom field is Date Picker type (instead of Date Time Picker), and you have selected to import this field as Property, the time for Date Picker issue property will be set to that days 00:00:00 in eazyBI. You can still use this in the DateDiffHours function, but note that the hours difference will be calculated with beginning of day. Maybe instead it is better to use the DateDiffDays function that would ignore the time?

To use another Issue property instead of 'Resolved at' you can write this custom fields name in the to_date argument of function. For example, if the custom date field name in JIRA is 'Date for testing' the formula would be as follows 

Median(
  Filter(
    NonEmptyCrossJoin(
        Descendants([Issue].CurrentMember, [Issue].[Issue]),
        [Measures].DefaultMember),
      [Measures].[Issues created] > 0
    ),
  DateDiffDays([Issue].get('Created at'),
    [Issue].get('Date for testing'))
)

Please let me know if you have any additional questions. Note that you can contact me directly at support@eazybi.com

Kind regards,
Lauma 

Peter Bengov Community Champion Feb 24, 2015

Hey Lauma, thanks for the answer. I tried this change but it didn't get any results back. Just inserted the field name into [Issue].get('<field name>')). BTW, the field was change to a date-time custom field. Maybe there is a need to add "at"/"on" right after the field's name?

Hi Peter, To debug this, could you select the Issues dimension on rows and expand some project where issues have the custom date field and then from Measures / Calculated members / Issue properties select the custom date field property on columns - does it show up for issues? You can see exact property name that should be used in the above formula by clicking on edit for the Property calculated Measure. Please send me as screenshot of above report if you still experience problems after finding the Issue property with the custom date. Kind regards, Lauma

Peter Bengov Community Champion Jun 15, 2015

Thanks Lauma, I was able to get this working by changing the Formatting for that field's Issue Property to Data and Time (was Month Day Year before).

This widget could not be displayed.
Peter Bengov Community Champion Jan 11, 2015

@Lauma, maybe you have an idea on how to do this?

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted yesterday in Jira

What modern development practices are at the heart of how your team delivers software?

Hey Community mates! Claire here from the Software Product Marketing team. We all know software development changes rapidly, and it's often tough to keep up. But from our research, we've found the h...

47 views 0 1
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you