Jira Expressions - Text
Overviewβ
| "Jira Expressions - Text" allows you to create calculated custom fields using Jira Expressions. To create and configure this field, refer to the native Jira Custom Fields page. |
|---|
Jira expressions syntaxβ
To retrieve the priority of a work item's parent using Jira Expressions, use the following:
issue.parent?.priority?.name
Explanation:
issue.parent: Accesses the parent work item of the current work item.β?.: The optional chaining operator ensures that if parent is null or undefined (that is, the work item has no parent), the expression will return null instead of causing an error.β.priority: Accesses the priority field of the parent work item.β.name: Retrieves the name of the priority (for example, "High", "Medium", "Low").
Global variablesβ
user: The current user. Equal to null if the request is anonymous.app: This Forge app that made the request or provided the module.issue: The current work item.project: The current space.
Inputs and defaultsβ
- Expression: Jira expression that returns the text value for this field.
- Global variables:
issue,project,user, andappare available in expression scope.
Example configurationβ
Show parent priority text:
issue.parent?.priority?.name
This configuration returns the parent work item priority name when a parent exists.
Expected resultβ
- The field shows expression output as text on the work item.
- Null-safe expressions can produce empty results when source data is missing.
Edge casesβ
- Work items without parent relationships return empty results for parent-based expressions.
- Expression syntax or data-access errors can produce unexpected output and should be validated with work-item-level testing.
Examplesβ
Assignee's user groupsβ
Lists all user groups that include the current work item's assignee as a member.
issue.assignee
? issue.assignee.groups.join(', ')
: [];
Attachment contributorsβ
Identifies all users who have uploaded attachments to this work item.
issue.attachments?.length
? issue.attachments.map(attachment => attachment.author.displayName).join(', ')
: ''
Label countβ
Shows the total number of labels currently applied to the work item.
issue.labels?.length ?? 0
Parent priorityβ
Retrieve the priority of a work item's parent
issue.parent?.priority?.name
info
Check out the 'Snippets' section in the app for more useful examples.