History across two custom fields (Date & Value) and create Graph from this values

I have 2 custom fields, Audit date & Audit value. On a bi-weekly or monthly basis, users enter value in both the fields. For example:
Audit Date | Audit Value
1-Jan-2018 | 10
1-Feb-2018 | 20
1-Mar-2018 | 40
1-Apr-2018 | 60

Now I want to have this history of values across both fields, to display in similar table as shown above and also plot them graph, to show the trend of values across months. How do I achieve this? I tried to add Audit date as Dimension, but I kept getting an error. Any help would be helpful.

The simplest solution could be using value changes of custom field Audit value. If you are updating the value there on the same date/period when an audit took place it would represent the audit date as well.

You would like to import value changes for this number field. eazyBI support value changes import for Jira standard number custom fields by default.

eazyBI should import several measures representing historical values of this custom field. The measure Audit value history should show Audit value over time. You can use Time dimension in a report on Month level and see audit value at end of any month.

If you are updating values in both custom fields at any other time and Audit value changes to import and default measures are not enough, you would like to use JavaScript calculated custom field. Where you can go through issue change history for those two fields and combine them as one string in this structure:

date1,value1
date2,value2

Use comma separator for audit date and value and new line separator for each entry. You would like to use multiple_dates parameter for the custom field definition.

Here is an example custom field definition:

[jira.customfield_audit]
name = "Audit"
data_type = "integer"
measure = true
multiple_dates = true
javascript_code = '''
...
'''

I do not have JavaScript code as an example, though.

You would like to import value changes for Audit date, Audit value, and select the new custom field Audit** for import as measure into eazyBI after defining it into eazyBI advanced settings.

Daina / support@eazybi.com

I think this will help

var test = {}
issue.changelog.histories.forEach(function (history) {
history.items.forEach(function (historyItem) {
if (historyItem.fieldId == “customfield_20801”){
issue.testing_data = historyItem; //here is the value change ( from - to )
issue.testing_data2 = history; //here is the date and autor
}
});
});

We have two examples in our documentation on how to access history entries in JavaScript:

Last data when custom field changed

Days for Assignee

An example of Days for Assignees is closest to the case described here. It has more complex at one point, though. It includes changes per two dimensions Time, and Assignee and generates a result in this format:
Date1,Assignee1,1
Date2,Assignee2,1

It is not the same, but you can use this pattern as an example.

In Jira server, you can access changes in the field by name only. Jira on Cloud has an option to pick changed values in the field by field ID as well.

You would like to use this pattern for a new custom field name when assigning the values to it: issue.fields.customfield_nnnnnn where you can use some identifier instead of nnnnnn.

In my previous example, you would like to use issue.fields.customfield_audit in Javascript code to assign some values:

[jira.customfield_audit]
name = "Audit"
data_type = "integer"
measure = true
multiple_dates = true
javascript_code = '''
//...
issue.fields.customfield_audit = // .. some JS code here assigns values to the newly defined field
//...
'''

I used customfield_audit in the definition and in JavaScript code.

Daina / support@eazybi.com