Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 15 Next »

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-15'

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

Available macros

macrotypeapplies to fields

allow format output

manipulatingdescription
{{nowDate}}datedate, textyes
  • months,
  • weeks,
  • days,
  • hours,
  • minutes,
  • last day of the month
  • time zone
  • locale
flexible date macro with many options including formatting

{currentdate}

datedate, textno
  • days
simple date macro with capability of adding/subtracting days {currentdate+1}. 
{{nowDateTime}}date timedate time, textyes
  • months,
  • weeks,
  • days,
  • hours,
  • minutes,
  • last day of the month
  • time zone
  • locale
flexible date macro with many options including formatting
{currentdatetime}date timedate time, textno
  • days
simple date time macro with capability of adding/subtracting days {currentdatetime-1}

Example


Example of macros on edit task screen

If you enter date/datetime macros in an issue fields they will be  evaluated accordingly. 


Date field macros


  • {currentdate} - use this macro to insert current date when Jira issue is created, adding/subtracting days is supported (see examples below)
  • {{nowDate}}   - use this macro when more sophisticated date manipulation is required e.g. set the last day of month, add months, weeks, days (see examples below)



Examples of usage (assuming that today is 2018-10-15):

Macro expressionResultDescription

{currentdate}

2018-10-15it evaluates to current date
{currentdate+1}2018-10-161 day is added to current date
{currentdate-1}2018-10-141 day is subtracted from current date 
{{nowDate}}2018-10-15the same result as {currentdate}
{{nowDate 'lastDayOfMonth'}}2018-10-31it returns date of the last day of the month
{{nowDate 'tz' 'America/New_York'}}2018-10-15current date in New York
{{nowDate 'locale' 'es' 'format' 'MMMM'}}octubreOctober month name in Spanish
{{nowDate 'add' '1M'}}2018-11-151 month is added to current date
{{nowDate 'add' '2w 3d'}}2018-11-012 week and 3 days added to current date
{{nowDate 'subtract' '1M'}}2018-09-151 month is subtracted from current date
{{nowDate 'subtract' '2w 3d'}}2018-09-282 week and 3 days subtracted from current date




Datetime field macros


  • {currentdatetime} - use this macro to insert current date and time when Jira issue is created, adding/subtracting days is supported (see examples below)
  • {{nowDateTime}} -  use this macro when more sophisticated date manipulation is required e.g. set the last day of month, add hours, minutes (see examples below)



Examples of usage (assuming that today is 2018-10-15 13:00):

Macro expressionResultDescription

{currentdatetime}

2018-10-15T13:00:00.000it evaluates to current date
{currentdatetime+1}2018-10-16T13:00:00.0001 day is added to current date
{currentdatetime-1}2018-10-14T13:00:00.0001 day is subtracted from current date 
{{nowDateTime}}2018-10-15T13:00:00.000the same result as {currentdatetime}
{{nowDateTime 'lastDayOfMonth'}}2018-10-31T13:00:00.000date and time of the last day of the month
{{nowDateTime 'tz' 'America/New_York'}}2018-10-15T13:00:00.000-0400current date time in New York
{{nowDateTime 'locale' 'br' 'format' 'MMMM'}}HereOctober month name in Portuguese
{{nowDateTime 'add' '8h'}}2018-10-15T21:00:00.0008 hours added
{{nowDateTime 'subtract' '8h'}}2018-10-15T05:00:00.0008 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.000set hour to 17
{{nowDateTime 'lastDayOfMonth' 'hour' 16}}2018-10-31T16:00:00.000'lastDayOfMonth' and 'hour' functions combined 


Text field macros

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 expressionResultDescription
{{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 


Smart values from Jira automation

Following smart values are supported

Smar value
{{now}}
{{now.jiraDate}}
{{now.jiraDateTime}}
{{now.jqlDate}}
{{now.jqlDateTime}}
{{now.shortDate}}
{{now.shortTime}}
{{now.shortDateTime}}
{{now.mediumDate}}
{{now.mediumTime}}
{{now.mediumDateTime}}
{{now.longDate}}
{{now.longTime}}
{{now.longDateTime}}
{{now.fullDate}}
{{now.fullTime}}
{{now.fullDateTime}}
{{now.format(...)}}
{{now.plusMinutes(...)}}
{{now.plusHours(...)}}
{{now.plusDays(...)}}
{{now.plusWeeks(...)}}
{{now.plusMonths(...)}}
{{now.plusYears(...)}}
{{now.minusMinutes(...)}}
{{now.minusHours(...)}}
{{now.minusDays(...)}}
{{now.minusWeeks(...)}}
{{now.minusMonths(...)}}
{{now.minusYears(...)}}
{{now.endOfMonth}}
{{now.startOfMonth}}



If you have any question please raise support request at our service portal. We are happy to help!








  • No labels