Skip to main content

Jira Expressions - Text

Overview​

Jira Expressions - Text field icon"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, and app are 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.