---
title: "Fetch the comment added during a transition"
canonical: "https://support.appfire.com/space/JMWEC/466289814/Fetch%20the%20comment%20added%20during%20a%20transition"
format: markdown
---
> Macro (aura-html)

### 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 

```javascript
{% 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

<span style="color: #333333">The output of this snippet is a </span><span style="color: #333333">[String](http://docs.oracle.com/javase/6/docs/api/index.html?java/lang/String.html)</span><span style="color: #333333"> which you can use to:</span>

- <span style="color: #333333">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</span>
- <span style="color: #333333">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</span>
  - Comment in one of the Comment issue post-functions
  - Subject/HTML body/Text body of Email issue post-function
    

### References

- [Using Nunjucks Templates](https://appfire.atlassian.net/wiki/spaces/JMWEC/pages/465503811)
- [issue variable](https://appfire.atlassian.net/wiki/spaces/JMWEC/pages/465373277)
- [Accessing JIRA Standard fields](https://appfire.atlassian.net/wiki/spaces/JMWEC/pages/466225701)
- [now variable](https://appfire.atlassian.net/wiki/spaces/JMWEC/pages/465373277)
- [date filter](https://appfire.atlassian.net/wiki/spaces/JMWEC/pages/466323491), [last filter](https://appfire.atlassian.net/wiki/spaces/JMWEC/pages/465373240) and [field filter](https://appfire.atlassian.net/wiki/spaces/JMWEC/pages/465373638)

### Related articles

> Macro (contentbylabel)

> Macro (details)
> 
> | Related issues |  |
> | --- | --- |