Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Abstract

This code snippet fetches the comment added during a transition

...

Code Block
languagejs
linenumberstrue
{% 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

      Code Block
      languagejs
      linenumberstrue
      {% 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 %}


...

Filter by label (Content by label)
showLabelsfalse
max5
spacesKB
showSpacefalse
sortmodified
reversetrue
typepage
cqllabel = "jmwe-nunjucks" and type = "page" and space = "KBJMWE"
labelsjmwe-nunjucks jmwe-cloud

...