Date in original estimated time by other date measure

Hi!

We are building a report that shows the accumulated original estimated time of the subtasks of some issues. The problem is that the date used of the estimated time is the creation date of the subtask and we would like to use a different date on the same issue.

We have imported the date as a measure and a property, but I cannot get it to work.

Can somebody help me?

Hi Jose Maria

Measure Original estimate hours are related to issue creation date only. If you need to retrieve Original estimated hours with any other date, you can create a new custom field measure with JavaScript code. This measure will automatically be related to all default dates and any other date you are importing into eazyBI as a measure.

Here is a JavaScript custom field definition for Original estimated hours:

[jira.customfield_oe]
name = "Original estimated hours"
data_type = "decimal"
measure = true
javascript_code = '''
if (issue.fields.timeoriginalestimate) {
timeoriginalestimate = issue.fields.timeoriginalestimate / 3600.0;
issue.fields.customfield_oe = timeoriginalestimate;
}
'''

Please add the custom field definition to eazyBI advanced settings or ask Jira administrator to do this for you, as only Jira administrators, has access to eazyBI advanced settings.

Open Jira import settings for edit after changes in advanced settings and select the custom field for import as a measure and as a property and run an import. Import will create new measures with any date (Original estimated hours with due date, Original estimated hours with custom date, etc.) and property Issue Original estimated hours in your account.

Daina/ support@eazybi.com

2 Likes

Hi Daina!

That worked great!!! Thanks!

Actually these are subtasks of an issue type and we are looking to get a report that shows these hours generated by the script associated with the parent task. So what we are doing is a filter with the parent issues and then displaying the hours spent with subtasks.

Then I defined a calculated formula with this content to Sum all the subtasks with the original estimated hours with the field.

Sum(
[Issue].[Issue].GetmembersByKeys(
[Issue].CurrentHierarchyMember.get(‘Sub-task keys’)
),
[Issue.Sub-task].CurrentMember.get(‘Original estimated hours with fecha de comienzo’)
)

The problem is that it doesn’t show anything. There might be empty data, is this the problem?

Thanks for your reply again!
Jose

Hi Again,

I took a different approach but I’m still struggling to get the results I want.

We have the list of subtasks with the correct estimated hours by the date but we would like to show only the ones where the parent matches a specific attribute. I.E: .get(‘Código de aplicación’) = ‘DY_NUHC’

Can you support?

Thanks in advance,
Jose

Hi Jose

You are accessing sub-task property with function get. However, the property name you are using seems like measure Original estimated hours with fecha de comienzo - Original estimated hours by custom date fecha de comienzo.

Property names are case sensitive. You can check a correct formula of any issue property if you open the formula of it. In this case, expand Measures>Calculated members>Issue properties and open Issue Original estimated hours. Then copy the formula and use it in calculations.

It could be like this [Issue].CurrentHierarchyMember.get('Original estimated hours')

If you want to get only sub-tasks with value in custom date field fecha de comienzo you can add a Filter to sub-task set in your calculation.
The formula works on Parent issues only. You can add a CASE WHEN statement to retrieve any data from sub-task if a parent has a particular custom field Código de aplicación value:

CASE WHEN
[Issue].CurrentHierarchyMember.Get('Código de aplicación') = 'DY_NUHC'
THEN 
Sum(
Filter(
  [Issue].[Issue].GetmembersByKeys(
    [Issue].CurrentHierarchyMember.get('Sub-task keys')
  ),
  NOT isEmpty([Issue].CurrentHierarchyMember.Get('Fecha de comienzo'))
  ),
[Issue].CurrentHierarchyMember.get('Original estimated hours')
)
END

Please check the spellings of properties. They are case sensitive.

Daina / support@eazybi.com