It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

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

Peter Bengov Community Leader 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

0 votes
Answer accepted
Lauma Cīrule Jan 12, 2015

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 Leader 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?

Lauma Cīrule Feb 25, 2015

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

0 votes
Peter Bengov Community Leader Jan 11, 2015

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

Suggest an answer

Log in or Sign up to answer
This widget could not be displayed.
This widget could not be displayed.
Community showcase
Published in Next-gen

Introducing subtasks for breaking down work in next-gen projects

Teams break work down in order to help simplify complex tasks. This is often done iteratively, with tasks being broken down into smaller tasks and so on until the work is accurately captured in well-...

9,199 views 28 42
Read article

Community Events

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

Find an event

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

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you