Common modules
Compass modules
Confluence modules
Jira modules
Jira Service Management modules

Rate this page:

Jira issue view background script

The jira:issueViewBackgroundScript module adds an invisible container to the Issue view page.

This makes it the perfect candidate for:

  • distributing shared data
  • making heavy calculations
  • running code without UI elements

Examples

Because modules might be rendered in a different order, you should handle both scenarios.

Custom UI

Use the events API for communication between an issue view background script and an issue panel.

Issue view background script:

1
2
import { events } from '@forge/bridge';

// Emit the data to an already rendered issue panel
events.emit('app.data-change', 'initial-data');

// Listen to data change requests from issue panels
events.on('app.request-data', (payload) => {
  events.emit('app.data-change', 'initial-or-changed-data');
});

Issue panel:

1
2
import { events } from '@forge/bridge';

// Request data in case the background script is already rendered
events.emit('app.request-data');

// Listen to data change
events.on('app.data-change', (payload) => {
  console.log('The data has changed:', payload)
});

Properties

PropertyTypeRequiredDescription
key

string

YesA key for the module, which other modules can refer to. Must be unique within the manifest.

Regex: ^[a-zA-Z0-9_-]+$

resourcestringThe issue view background script module requires a resource when building with custom UI.A reference to the static resources entry that the issue view background script will render. See resources for more details.
resolver{ function: string }Contains a function property, which references the function module that defines the configuration of resource. Can only be set if the module is using the resource property.

Extension context

PropertyTypeDescription
typestringThe type of the module.
issue:
  id
stringThe ID of the issue on which the module is rendered.
issue:
  key
stringThe key of the issue on which the module is rendered.
issue:
  type
stringThe type of the issue on which the module is rendered.
issue:
  typeId
stringThe ID of the type of the issue on which the module is rendered.
project:
  id
stringThe ID of the project where the module is rendered.
project:
  key
stringThe key of the project where the module is rendered.
project:
  type
stringThe type of the project where the module is rendered.

Rate this page: