Our new Appfire Documentation Space is now live!

Take a look here! If you have any questions please email support@appfire.com

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 18 Next »

Abstract

This code snippet adds a certain number of days to a Date field.

Logic

Access the date and add the number of days to it.

Snippet 

{{ <Date field> | dateadd(<Number of days>,"d") }}

Placeholders

PlaceholderDescriptionExample
<Date Object>Access a date fieldissue.fields.created
<Number of days>
The number of days to be added5

Examples

The output of the code snippet is a Moment.js date object which you could to:

  • Set a Date/Date-time picker field - Eg: Set the Due date to issue created plus 5 days in
    • one of the Set Field Value post-functions
    • one of the Transition issue post-functions on the transition screen, if any
    • in the Create issue post-function under Set fields of new issue section

      {{ issue.fields.created | dateadd(5,"d") }}
  • Conditionally execute a post-function or Unlink issues - Eg: Check that the issue has been resolved for more than 10 days

    {{ issue.fields.Resolved > now | dateadd(10,"d") }}
  • Notify the customer that the issue will be resolved in 6 days from today through the
    • Comment in one of the Comment issue post-functions
    • Subject/HTML body/Text body of Email issue post-function

      Your issue will be resolved on/before {{ now | dateadd(6,"d") }}
  • 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') }}

References

Filter by label

There are no items with the selected labels at this time.

  • No labels