Sub-task inheriting value from Issue type

Hi Guys,

I have 2 different issue types and 1 sub-task that could be attached to the 2 issue types.
Both issue types have 1 custom field (number). I wanted to calculate the sum of that custom field for the sub-task issue type inheriting the value from the issue types.

From what I researched I believe I need to have in advanced settings a new field to collect this data.

To describe my scenario better this is the follow relevant data:
Issue type:
Light | ID=10507
Basic| ID=10506
Sub-task:
Extra | ID=10704
Custom field:
Value | Number | ID=10832

I have 2 different projects.
Project 1:
Light Value 2 and Extra
Light Value 1
Basic Value 1 and Extra
Project 2:
Light Value 1
Basic Value 5 and Extra

I am trying to reach to a table similar to this:
image

The first step I did, was creating an advanced setting.
I only tried for 1 issue type, to validate if it might work. Although I also feel I should have measure on he properties.

[jira.customfield_extra_value]
    name = "Extra Value"
    dimension = true
    data_type = "string"
    update_from_issue_key = "customfield_10507"
    javascript_code='''
    if (issue.fields.customfield_10832 && issue.fields.customfield_10832.value) {
      issue.fields.customfield_extra_value=issue.fields.customfield_10832.value;
    }
'''

The second step, I added the “Extra Value” to my imported custom fields (Import as dimension, Import as property).

The third step, in a new Analysis. I added “Projects” into rows and created the following new calculated measure:

Sum( 
  Filter(Descendants([Issue].CurrentMember,[Issue].[Issue]),
  [Measures].[Issue type]= "Extra"
  ),
  [Measures].[Extra Value resolved]
)

The result is not showing any value in this calculated column measure.
I have the following questions

  1. The update from issue key, I think I need to put the reference to the issue. Not sure if it is well represented.

  2. It is strange to me, how creating the custom field extra value, it will be mapped from the issuetype to the sub-task.

Any help to solve this, would be much appreciated.
Thank you

Hi @Tiago_Pinto,
You should change those lines:

dimension = true
data_type = "string"

to

measure = true
data_type = "numeric"

Whenever changing advanced settings for custom fields, you might want to perform double data import to ensure the correct outcome of changes (https://docs.eazybi.com/eazybijira/data-import/advanced-data-import-options/import-issue-links#Importissuelinks-Troubleshooting).

  1. In the import option, deselect custom fields “Extra Value” from data import and import data. This action will clear the previous data and data structures (even you see them as empty).
  2. When data import is completed, update the advanced settings for the field “Extra Value”. Save the changes.
  3. In the import option, select the custom field “Extra Value” for data import and import data for the second time.

This will create a measure Extra Value resolved in the Measure dimension that you can use to create a tuple for your report in the Measure dimension:

([Measures].[Extra Value resolved], [Issue type].[Extra])

best,
Gerda //support@eazyBI.com

1 Like

Thank your reply @gerda.zandersone .
I did the suggested changes and I got the following error: “Invalid data_type “numeric” for jira.customfield_extra_value in advanced settings”.

I’m I pointing to the wrong customfield ID’s in the advanced field configuration?

Hi @Tiago_Pinto,
it looks that your customfield “Extra value” contains non-numeric values and because of that there is an error in data import.
If your customfield contains only numeric values, then please try to empty the cube and re-import all data - https://docs.eazybi.com/eazybijira/data-import/jira-issues-import#JiraIssuesImport-Emptycubeandre-importallissues
Also please pay attention to the steps that I mentioned above what to do when changing anything in eazyBI advanced settings.

Gerda

1 Like

Hi @gerda.zandersone,

I did clean the data. and tried again to re-import and I still have the same error.
I suspect that the problem might be in the “update_from_issue_key” and the javascript code.

I tried above to detail the jira ID’s for those fields. But would like to know if that is actually correct?