Macro is an expression in recurring task field that is evaluated during Jira issue creation e.g. "{currentdate}" string is replaced with current date: '2018-10-1915'
...
Tip |
---|
Macros |
...
can be applied multiple times in the same text field and once in a date or date time field type. |
Macros can be applied for the following field types
...
- Text,
- Date
- Datetime
...
Available macros
macro | type | applies to fields | allow format output | manipulating | description |
---|---|---|---|---|---|
{{nowDate}} | date | date, text | yes |
| flexible date macro with many options including formatting |
date | date, text | no |
| simple date macro with capability of adding/subtracting days {currentdate+1}. | |
{{nowDateTime}} | date time | date time, text | yes |
| flexible date macro with many options including formatting |
{currentdatetime} | date time | date time, text | no |
| simple date time macro with capability of adding/subtracting days {currentdatetime-1} |
Example
If you enter date/datetime macros in an issue fields they will be evaluated accordingly.
Macros
...
Date field macros
Anchor | ||||
---|---|---|---|---|
|
Tip |
---|
|
...
Tip |
---|
Use
|
Examples:
- "{currentdate}" ,just current date
- "{currentdate+1}" - currentdate + 1 day
- "{currentdate-1}" - currentdate - 1 day
"{currentdatetime}"
Tip |
---|
Use this macro to enter current date and time in text or date field. During processing (schedule time) of the task macro will be replaced with current date and time. |
Examples:
- "{currentdatetime}" ,just current date and time
- "{currentdatetime+1}" ,current date and time plus one day
- "{currentdatetime-1}" ,current date and time minus one day
|
Examples of usage (assuming that today is 2018-10-15):
Macro expression | Result | Description |
---|---|---|
{currentdate} | 2018-10-15 | it evaluates to current date |
{currentdate+1} | 2018-10-16 | 1 day is added to current date |
{currentdate-1} | 2018-10-14 | 1 day is subtracted from current date |
{{nowDate}} | 2018-10-15 | the same result as {currentdate} |
{{nowDate 'lastDayOfMonth'}} | 2018-10-31 | it returns date of the last day of the month |
{{nowDate 'tz' 'America/New_York'}} | 2018-10-15 | Sets time zone to New York time |
{{nowDate 'locale' 'es' 'format' 'MMMM'}} | octubre | October month name in Spanish |
{{nowDate 'add' '1M'}} | 2018-11-15 | 1 month is added to current date |
{{nowDate 'add' '2w 3d'}} | 2018-11-01 | 2 week and 3 days added to current date |
{{nowDate 'subtract' '1M'}} | 2018-09-15 | 1 month is subtracted from current date |
{{nowDate 'subtract' '2w 3d'}} | 2018-09-28 | 2 week and 3 days subtracted from current date |
Datetime field macros
Anchor | ||||
---|---|---|---|---|
|
Tip |
---|
|
Examples of usage (assuming that today is 2018-10-15 13:00):
Macro expression | Result | Description |
---|---|---|
{currentdatetime} | 2018-10-15T13:00:00.000 | it evaluates to current date |
{currentdatetime+1} | 2018-10-16T13:00:00.000 | 1 day is added to current date |
{currentdatetime-1} | 2018-10-14T13:00:00.000 | 1 day is subtracted from current date |
{{nowDateTime}} | 2018-10-15T13:00:00.000 | the same result as {currentdatetime} |
{{nowDateTime 'lastDayOfMonth'}} | 2018-10-31T13:00:00.000 | date and time of the last day of the month |
{{nowDateTime 'tz' 'America/New_York'}} | 2018-10-15T13:00:00.000-0400 | Current date time in New York |
{{nowDateTime 'locale' 'br' 'format' 'MMMM'}} | Here | October month name in Portuguese |
{{nowDateTime 'add' '8h'}} | 2018-10-15T21:00:00.000 | 8 hours added |
{{nowDateTime 'subtract' '8h'}} | 2018-10-15T05:00:00.000 | 8 hours subtracted |
{{nowDateTime 'lastDayOfMonth' 'add' '8h'}} | 2018-10-31T21:00:00.000 | 'lastDayOfMonth' and 'add' functions combined |
{{nowDateTime 'hour' 17}} | 2018-10-15T17:00:00.000 | set hour to 17 |
{{nowDateTime 'lastDayOfMonth' 'hour' 16}} | 2018-10-31T16:00:00.000 | 'lastDayOfMonth' and 'hour' functions combined |
Text field macros
Anchor | ||||
---|---|---|---|---|
|
All macros {currentdate}, {currentdatetime}, {{nowDate}}, {{nowDateTime}} can be used in Text fields. Examples for Date and Datetime fields are also valid for Text fields.
Moreover {{nowDate}}, {{nowDateTime}} macros have functions helping to format an output e.g.:
Macro expression | Result | Description |
---|---|---|
{{nowDate 'format' 'DD.MM.YYYY'}} | 15.10.2018 | |
{{nowDate 'format' 'MMMM'}} | October | |
{{nowDateTime 'format' 'DD.MM.YYYY HH:mm'}} | 15.10.2018 13:00 | |
{{nowDateTime 'lastDayOfMonth' 'format' 'DD MMMM'}} | 31 October | 'lastDayOfMonth' and 'format' functions are combined |
If you have any question please raise support request at our service portal. We are happy to help!