Change history for Java Script calculated fields?

Dear eazyBI team,

I would love to have a change history for Java Script calculated fields. The same I’d like to have for fields calculated with JMCF.

Actually, I think I read somewhere, that it’s not possible for fields calculated with JMCF, and I guess it’s not possible for Java Script calculated fields either. Still, I hope you have a solution meanwhile :slight_smile:

Best regards,
Jan

Hi @JanHeg ,

Unfortunately, it is impossible to save the history of a JavaScript calculated custom field, as the values are re-calculated on each data import.

If the value, which history you are looking for, initially comes from a Jira custom field, you can import the history. See an example for due date changes - Jira calculated and scripted custom fields - eazyBI for Jira. Or an example for days for assignee - JavaScript calculated custom fields - eazyBI for Jira.

Best,
Roberts // support@eazybi.com

Dear @roberts.cacus ,

thanks a lot for the ideas!

I finally managed to look into the topic again, and was able to create a calculated custom field with JMCF that contains date - value tuples for each day the value changed. Unfortunately, this doesn’t provide me with what I need for eazyBI obviously.

My use case is that I collect number of errors in a document, and I’ve got multiple issues, each for one document. What I would like to see are (hopefully :)) error burn down curves over time.

Maybe an example could help:
In one case I’ve got the following value of the newly created custom field:

2021-06-22,27
2021-06-23,0
2021-09-09,5

In another case it’s this value:

2021-06-22,0
2021-09-07,2
2021-09-11,0

When I now plot a line diagram for one of those tickets I only get data points at the days collected in the custom field. What I would like to end up is a line diagram which also has data points in between. This is especially important, if you’ve got issues which have got data points at different days like shown above, but those values are summed up if looking on all issues.

Do I need to adapt my custom field code, so the custom field already contains all dates with the respective value, or is there any solution in eazyBI?
The first option would look somehow like this:

2021-06-22,27
2021-06-23,0
2021-06-24,0
2021-06-25,0
2021-06-26,0
2021-06-27,0
2021-06-28,0

2021-09-06,0
2021-09-07,0
2021-09-08,0
2021-09-09,5
2021-09-10,5
2021-09-11,5
2021-09-12,5

This especially does not work at the end, I think. Because if I’d need to something like this, I would need to go until “today” date always, which would mean I would need to reindex the Jira project each day if I’m not mistaken.

Dear @roberts.cacus,

any ideas here?

Best regards,
Jan

Hi,

I finally found a solution myself (at least for numerical values, not for string values, see below).

So, for numerical values I moved to not putting the absolute value in the calculated field, but the change on each day it changed. The example from above was

2021-06-22,27
2021-06-23,0
2021-09-09,5

and is now

2021-06-22,27
2021-06-23,-27
2021-09-09,5

Then, I added those settings to Advanced settings:

[jira.customfield_<number of the custom field>]
data_type = “integer”
measure = true
multiple_dates = true

In addition to that, I created a calculated measure like this:

Cache(
NonZero(Sum(PreviousPeriods([Time].CurrentHierarchyMember),
Cache([Measures].[<name of the measure containing the history>])
))
+ [Measures].[<name of the measure containing the history>]
)

This does the trick for numerical values.
Unfortunately, I also need to do the same for string values.

Let’s say I have something like this:

2021-06-22,has errors
2021-06-23,ok
2021-09-09,has warnings

Then in the end I want to end up with a table (or bar chart) containing number of issues with a specific value from this history at a specific date.
E.g. like that:

||Time||has errors||has warnings||ok||
|CW40|12|43|52|
|CW41|8|45|54|

@roberts.cacus: any chance to do something like this? In the end it’s similar to the transition status history thing, but currently I’ve got no clue whether it’s even possible to something like this with the current means of eazyBI.

I found a solution for the history of string values as well. It’s a workaround which probably does not work in a lot of cases, but for us it does.
And here it is: the numerical values for number of fatal errors, errors and warnings can be used to calculate the string value (has errors, has warnings, ok, n/a in my case) as a measure within eazyBI.
There are several measures that I needed to create:

  1. a measure to calculate the history of the string value over time called “status history”

CASE WHEN IsEmpty([Measures].[fatal error history]) AND
IsEmpty([Measures].[error history]) AND
IsEmpty([Measures].[warning history])
THEN “n/a”
ELSE CASE WHEN ([Measures].[error history] = 0 OR IsEmpty([Measures].[error history])) AND
([Measures].[fatal error history] = 0 OR IsEmpty([Measures].[fatal error history]))
THEN CASE WHEN ([Measures].[warning history] = 0 OR IsEmpty([Measures].[warning history]))
THEN “ok”
ELSE “has warnings”
END
ELSE “has errors”
END
END

  1. measures to count how many times one of the values (has errors, has warnings, ok, n/a) occurs, here exemplary for has errors

Count(
Filter(
Descendants([Issue].Currentmember, [Issue].[Issue]),
[Measures].[status history] MATCHES “has errors”
)
)

This whole solution (incl. the previous comment) works for us, but involves really a lot of JMCF fields in Jira and measures in eazyBI.

Setting this topic to solved.