year()

This function returns the year part of a timestamp based on a given time zone

Bash
year(timestamp, timeZone) #Output: Number

Examples

Parser expression

Description

Bash
 %{year({issue.created}, RUN_AS_LOCAL)}

This example returns the year part of the issue creation date

If the issue was created on March 25th, 2020 23:15:30 the output would be 2020.

Bash
%{year(stringToDate("2020-01-01 00:30","Europe/Berlin"),"UTC")}

This example returns the year part of the given date, the timezone is UTC.

Due to the time zone UTC, the output will be 2019.

Additional information

Parameters used in this function

Parameter

Input (data type)

Description

timestamp

number

The parameter must be valid timestamp. Usually this value is retrieved from a field (e.g. due date, created date).

timeZone

text

The time zone used for the calculation.

Work days might depend on the time zone - it might be Dec 31st on the west coast of the US while at the same time it's already Monday Jan 1st in Australia.

Output

This function returns a number


(books) Use cases and examples