Standard JIRA Fields
This page explains how to access the value of Standard Jira fields using Nunjucks. Each field's structure is explained with examples. To understand how to write values into these fields see, Text input for fields and JSON input for fields.
It is now possible to access the standard fields of an issue by its Field name or Key.
Example:
{{ issue.fields.watches.watchCount }}
and {{ issue.fields.Watchers.watchCount }},
both return the number of watchers.
When the field name contains a space or any special character, you need to use the array syntax to access the field :
Example:
{{ issue.fields['Issue Type'].name }}
{{ issue.fields['Component/s'][0].name }}
Affects Version/s
Field name :
Affects Version/s
Key:
versions
Description : The Affects Version/s field is an array of objects. Each object represents a single version.
Structure :
Accessing the Affects version/s field :
First Affects Version name :
{{issue.fields.versions[0].name}}
Last Affects Version name:
{{ issue.fields.versions | last | field("name")}}
where '|' is the pipe operator, 'last' and 'field' are filters. See Nunjucks annotations for more filters.
Join the names of the Affects Version/s, separated by commas:
{{issue.fields.versions | join("," , "name")}}
Return all the Affects Version/s, in a format that can be used to set the Fix Version/s field :
{{issue.fields.versions | dump(2)}}
Test whether "1.0" is in the Affects Version/s:
{{ issue.fields.versions | find({name:"1.0"}) }}
Assignee
Field name :
Assignee
Key:
assignee
Description : The Assignee field is an object that represents the user who this issue is assigned to.
Structure :
Accessing the Assignee field :
AccountId of the Assignee :
{{issue.fields.assignee.accountId}}
Timezone of the assignee :
{{issue.fields.assignee.timeZone}}
Attachments
Field name :
Attachment
Key:
attachment
Description : Attachment is an array of objects. Each object represents a single attachment.
Structure :
Accessing the Attachment field:
Size of the last attachment :
{{ issue.fields.attachment | last | field("size")%}
where '|' is the pipe operator, 'last' and 'field' are filters. See Nunjucks annotations for more filters.
Name of the Author of the first attachment :
{{ issue.fields.attachment[0].author.accountId}}
Created
Field name :
Created
Key:
created
Description : The Created field is a string representation of a date.
Structure :
Accessing the Created fields :
Created date of the issue :
{{ issue.fields.created }}
Format the created date :
{{ issue.fields.created | date('fromNow') }}
You can use the date filter to manipulate and/or format the value
Creator
Field name :
Creator
Key:
creator
Description : The Creator field is an object that represents the user who created this issue.
Structure :
Accessing the Creator field :
Name of the Creator of the issue :
{{ issue.fields.creator.accountId }}
Display name of the creator :
{{ issue.fields.creator.displayName }}
Comments
Field name :
Comment
Key:
comment
Description : The Comments field is an object with two fields:
comments
, containing an array of objects. Each object represents a single comment.total
, showing the number of comments
Structure :
Accessing the Comments field:
Number of comments on the issue :
{{issue.fields.comment.total}}
Last Comment body :
{{ issue.fields.comment.comments | last | field("body") }}
where '|' is the pipe operator, 'last' and 'field' are filters. See Nunjucks annotations for more filters.
AccountId of the author of the first comment on the issue :
{{ issue.fields.comment.comments | first | field("author.accountId") }}
where '|' is the pipe operator, 'first' and 'field' are filters. See Nunjucks annotations for more filters.
Email address of the author of the last comment on the issue :
{{ issue.fields.comment.comments | last | field("author.emailAddress") }}
where '|' is the pipe operator, 'last' and 'field' are filters. See Nunjucks annotations for more filters.
Display all the comments in a text field :
{{ issue.fields.comment.comments | join("\n" , "body") }}
Component/s
Field name :
Component/s
Key:
components
Description : The Components field is an array of objects. Each object represents one component.
Structure :
Accessing the Components field :
First component name :
{{issue.fields.components[0].name}}
Last component description :
{{ issue.fields.components | last | field("description") }}
where '|' is the pipe operator, 'last' and 'field' are filters. See Nunjucks annotations for more filters.
All components of the current issue:
{{issue.fields.components | join ("," , "name") }}
Test whether "UI" is in the Components:
{{ issue.fields.components | find({name:"UI"}) }}
Description
Field name :
Description
Key:
description
Description : The Description field is a string representation of a multi-line text describing the issue.
Structure :
Accessing the Description field :
Description of the issue :
{{issue.fields.description}}
You are viewing the documentation for Jira Cloud.
On This Page
- 1 Affects Version/s
- 2 Assignee
- 3 Attachments
- 4 Created
- 5 Creator
- 6 Comments
- 7 Component/s
- 8 Description
- 9 Due Date
- 10 Environment
- 11 FixVersion/s
- 12 Issue links
- 13 Issue type
- 14 Key
- 15 Labels
- 16 Last Viewed
- 17 Original Estimate
- 18 Parent
- 19 Priority
- 20 Progress
- 21 Project
- 22 Remaining Estimate
- 23 Reporter
- 24 Resolution
- 25 Resolved
- 26 Security level
- 27 Status
- 28 Subtasks
- 29 Summary
- 30 Time spent
- 31 Time tracking
- 32 Updated
- 33 Votes
- 34 Watchers
- 35 Work log
- 36 Work Ratio
- 37 ∑ Original Estimate