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

Rate this page:

Jira issue context

We’re rolling out this feature gradually, so it may not be available to you before 31st March 2023.

If your app previously use Issue Glance module and you want to migrate to the Issue Context module. Check out How to future-proof your Issue Glance implementation on how to migrate.

The jira:issueContext module adds a collapsible panel under the other fields on the right side of the issue view. These panels give your users a quick way to get information related to the issue from your app. Users can expand these panels to view app information or collapse them if they don’t need it.

This module can be used in Jira Work Management, Jira Software, and Jira Service Management.

It works in the new issue view but not the old issue view.

See the IssueContext component documentation for more information.

Properties

PropertyTypeRequiredDescription
key

string

Yes

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

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

functionstringThe issue context module requires either a function for usage with the UI kit, or a resource when building with custom UI.A reference to the function module that defines the issue context. This function must return the IssueContext component.
resourcestringA reference to the static resources entry that your issue context panel wants to display. 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.
titlestringYesThe title of the issue context panel, which is displayed next to its label.
labelstringYesThe text shown on the button for the issue context panel.
iconstringThe absolute URL of the icon that is displayed to the left of the label on the button for the issue context panel.
statusobjectThe badge, lozenge, or icon shown to the right of the label. If status is not specified, then nothing is shown. See status properties.
displayConditionsobjectThe object that defines whether or not a module is displayed in the UI of the app. See display conditions.
dynamicProperties{ function: string }Contains a function property, which references the function module that returns changeable properties. See Dynamic properties for more details.

Status properties

PropertyTypeRequiredDescription
type'badge' | 'lozenge' | 'icon'YesThe UI element used to display the status.
valueobjectYes

This property is an object representing the status value. See status value properties.

Status value properties

PropertyTypeRequiredDescription
labelstringYesThe text to display in the status.

If type is 'badge', this property is a number specified as a string (for example, '3').

urlstring

If type is 'icon', this value controls the URL of the icon to display in the status.

type'default' | 'inprogress' | 'moved' | 'new' | 'removed' | 'success'

If type is 'lozenge', this value controls the appearance of the status.

Dynamic properties

Dynamic properties are used to dynamically update the status property. If provided in the manifest.yml file, Jira attempts to retrieve the dynamic properties on the initial render of the app. To do this, the dynamicProperties handler function of the app is called. When the issue context item is clicked, the app renders in the collapsible panel, where it can perform business logic updates. After the panel is collapsed, the handler function is called to retrieve updates, and then update the status.

We're working on integrating 3LO consent with dynamic properties. If you’re using api.asUser().requestJira, and your user doesn't provide consent for your app through another method, api.asUser().requestJira will fail to execute.

The app's handler function is passed the payload argument. The payload object has the following structure:

1
2
interface Payload {
  // The cloudId for your site 
  cloudId: string;
  extension: {
    // The module type included in the manifest.yml file.
    // In this case, it is the "jira:issueContext" module.
    type: string;
    issue: {
      id: string,
      type: string,
      key: string,
      typeId: string
    },
    project: {
      id: string,
      type: string,
      key: string
    }
  };
}

The handler function should return (or resolve with) a plain JavaScript object with status as key.

This is an example of a handler function returning an object:

1
2
function handlerFunction(contextPayload) {
  return {
    "status": {
      "type": "lozenge",
      "value": {
        "label": "Dynamically set status",
        "type": "moved"
      }
    }
  };
}

Extension data

Custom UI

Use the getContext bridge method to access the extension context in custom UI.

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.

UI kit

Use the useProductContext hook to access the context in UI kit.

Extension context

PropertyTypeDescription
typestringThe type of the module.

Platform context

PropertyType/valueDescription
issueIdstringThe ID of the issue on which the module is rendered.
issueKeystringThe key of the issue on which the module is rendered.
issueTypestringThe type of the issue on which the module is rendered.
issueTypeIdstringThe ID of the type of the issue on which the module is rendered.
projectIdstringThe ID of the project where the module is rendered.
projectKeystringThe key of the project where the module is rendered.
projectTypestringThe type of the project where which the module is rendered.

Rate this page: