Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Info
titleAvailability

This routine is available starting with SIL Engine™ 4.0.4.

Syntax

getFieldChanges(key, history_field_name)

...

Excerpt

Returns a list of tuples containing user||field|oldVal|newVal for the selected field from the selected issue's history.

...

Parameter name

Type

Required

Description

issue key

String

Yes

Key The key of the selected issue.

history_field_name

String

Yes

Name The name of the selected field.

Return type

JFieldChanges []

The return value is an array of JFieldChange. The strings come in pairs. The first value is a :

  1. A date representing the time when the value was modified

...

  1. The content of the requested field at that date.

Example

Code Block
JFieldChange[] changes  = getFieldChanges("TEST-10", "My Text Field");

return changes;

Result: 

admin|2017-05-23 13:28:05|My Text Field||test|admin|2017-05-23 13:28:09|My Text Field|test|lalaa

...

Code Block
JFieldChange[] changes  = getFieldChanges("TEST-10", "customfield_10200");

JFieldChange latestChange = changes[0];
date newest = latestChange.changeDate;

for (JFieldChange change in changes) {
    if (change.changeDate > newest) {
        latestChange = change;
    }
}
return latestChange;

Result: 

Done. Program returned: admin|2017-05-23 13:28:09|Text Field|aaaaa|nnnnn

...