Versions Compared

Key

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

This routine is available starting with katl-commons 1.0.
Starting with version 4.0.0, the second parameter can be custom field id.

This routine is available for Jira server and cloud deployment options.
Info
titleAvailability
Table plus
applyColStyleToCelltrue
heading0
columnTypess,s,s,s
multiplefalse
columnAttributesstyle="background:#e5e7ea;font-weight:bold,,style="background:#e5e7ea;font-weight:bold,
enableSortingfalse

Syntax

fieldHistory(key, history_field_name_or_id)

Package

Alias

Pkg Usage

Description

Excerpt
hiddentrue
Returns all the pairs date + value for the selected field from the selected issue's history.

Returns all the pairs date + value for the selected field from the selected issue's history.

Parameters

Table plus
applyColStyleToCelltrue
columnTypess,s,s,s
heading0
multiplefalse
enableSortingfalse

Parameter name

Type

Required

Description

issue key

String

Yes

Key of the selected issue.

field name or id

String

Yes

Name or the id of the selected field.

Return

...

Type

string String []

The return value is an array of strings. The strings come in pairs. The first value is a date representing the time when the value was modified and the second value is the content of the requested field at that date.

Examples

Example 1

Code Block
//values for field Amount are 2000 at 12.02.2011, 3000 at 13.03.2011 and 4000 at 10.05.2011
string field_name;
string[] field_history;
field_name = "Amount";
field_history = fieldHistory(key, field_name);

Result: |12/02/2011|2000|13/03/2011|3000|10/05/2011|4000

Example 2

Code Block
//values for field Amount are 2000 at 12.02.2011, 3000 at 13.03.2011 and 4000 at 10.05.2011
string field_name;
string[] field_history;
field_history = fieldHistory(key, customfield_10101); 		//customfield_10101 = Amount

Result: |12/02/2011|2000|13/03/2011|3000|10/05/2011|4000

...

Note

  1. Besides the labels of the custom fields, the name of the standard Jira fields (summary, assignee, and so on) can be used as parameters.
  2. If it returns an empty array, you must get the last value of the field from the issue.
  3. The second parameter is the field name as it appears in history or the custom field id.

See also

Filter by label (Content by label)
showLabelsfalse
max25
showSpacefalse
cqllabel = "jira_fieldcustomfield_routine" and space = currentSpace ( )
labelsjiraarray_field_routineroutines