Skip to main content

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 an issue's parent using Jira Expressions, use the following:

issue.parent?.priority?.name

Explanation:

  • issue.parent: Accesses the parent issue of the current issue.​
  • ?.: The optional chaining operator ensures that if parent is null or undefined (i.e., the issue has no parent), the expression will return null instead of causing an error.​
  • .priority: Accesses the priority field of the parent issue.​
  • .name: Retrieves the name of the priority (e.g., "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 issue.
  • project: The current project.

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 issue priority name when a parent exists.

Expected result​

  • The field shows expression output as text on the issue.
  • Null-safe expressions can produce empty results when source data is missing.

Edge cases​

  • Issues 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 issue-level testing.

Examples​

Assignee's User Groups​

Lists all user groups that include the current issue's assignee as a member.

issue.assignee
? issue.assignee.groups.join(', ')
: [];

Attachment Contributors​

Identifies all users who have uploaded attachments to this issue.

issue.attachments?.length
? issue.attachments.map(attachment => attachment.author.displayName).join(', ')
: ''

Label Count​

Shows the total number of labels currently applied to the issue.

issue.labels?.length ?? 0

Parent priority​

Retrieve the priority of an issue's parent

issue.parent?.priority?.name
info

Check out the 'Snippets' section in the app for more useful examples.