Our new Appfire Documentation Space is now live!
Take a look here! If you have any questions please email support@appfire.com
Fetch the comment added during a transition
Abstract
This code snippet fetches the comment added during a transition
Logic
Access the body of the last comment of the issue, if it was created less than 6 seconds before.
Snippet
{% if issue.fields.comment.comments and now | date('diff',issue.fields.comment.comments | last | field("created")) < 6000 %} {{ issue.fields.comment.comments | last | field("body") }} {% endif %}
Placeholders
NA
Examples
The output of this snippet is a String which you can use to:
- Set a text field with the comment that was just created. Eg: Set a custom text field to the comment that was just added in one of the Set field value post-functions
- Notify of the most recent comment. Eg: Adding the most recent comment on the issue to its linked issues or as subject of an Email etc
- Comment in one of the Comment issue post-functions
Subject/HTML body/Text body of Email issue post-function
{% if issue.fields.comment.comments and now | date('diff',issue.fields.comment.comments | last | field("created")) < 6000 %} A comment: "{{ issue.fields.comment.comments | last | field("body") }}" has been added on the linked issue. {% endif %}
References
- How to insert information using Nunjucks annotations
- issue variable
- Accessing JIRA Standard fields
- now variable
- date filter, last filter and field filter
Related articles
Filter by label
There are no items with the selected labels at this time.