This code snippet adds a certain number of minutes/hours/days/weeks/months to a Date field.
Access the date and add the number of minutes/hours/days/weeks/months to it.
{{ <Date field> | dateadd(<Number of units>,"<Unit>") }} |
Placeholder | Description | Example |
---|---|---|
<Date Object > | Access a date field |
|
<Number of units> | The number of units to be added | 5 |
<Unit> | is one of "days", "hours", "weeks" or "months" (or their equivalent: "d", "h", "w", "m") | days |
The output of the code snippet is a Moment.js date object which you could use to:
in the Create issue post-function under Set fields of new issue section
{{ issue.fields.created | dateadd(1,"m") }} |
Conditionally execute a post-function or Unlink issues - Eg: Check that the issue has been resolved for more than 10 days
{{ now > issue.fields.Resolved | dateadd(10,"d") }} |
Subject/HTML body/Text body of Email issue post-function
Your issue will be resolved on/before {{ now | dateadd(6,"hours") }} |
Write a JQL search expression in the Link issues to current issue post-function - Eg: Link issues whose "Planned Delivery date" is less than two days
{{ issue.fields["Planned Delivery Date"] < now | dateadd(2,"d") | date('YYYY-MM-DD') }} |
|