Field Behaviour Examples

The following examples are available in-app via the Example scripts modal when you're configuring field behaviours. You can copy, paste, and customize any script to suit your needs, then configure each field behaviour to apply to the spaces, work item types, and views you want.

Set the default value for the summary field

Set the summary field to a default value when the work item is opened or created.

Why it’s useful: Provides a starting point for users, encourages consistent naming patterns, and reduces the chance of empty or unclear summaries.

Set the description field using markdown

Populate the description field with markdown content, which is automatically converted to Atlassian Document Format (ADF).

Why it’s useful: Lets you define reusable templates (for example, acceptance criteria or checklists) so descriptions are structured and complete without users having to retype standard content.

Change a field's display name

Override the display name of a field (for example, rename the priority field).

Why it’s useful: Allows you to use terminology that matches your team’s language or business domain while still relying on the same underlying field and data.

List screen tabs

Read the screen tabs available on the current screen with getScreenTabs() and log each tab’s id, position, and visibility.

Why it’s useful: Helps you inspect the current screen configuration and serves as a starting point when you want to build more advanced tab-related behaviours.

Targeting screen tabs by position

When you call getScreenTabs(), it returns an array of tabs in the same order they appear on the screen. This means you can work with tabs by their position instead of looking up their id. For example, to access the second tab:

javascript
const tabs = api.getScreenTabs?.() ?? [] const secondTab = tabs[1] secondTab?.setVisible(false)

This can be easier than finding and maintaining explicit tab ids, especially if you only need to show or hide tabs based on their position.

Hide a screen tab

Hide a tab on the work item screen by targeting its position.

Why it’s useful: Lets you simplify screens for specific contexts or user groups by hiding tabs that are not relevant, reducing clutter and potential confusion.

On this page