• About the JavaScript API
  • AP
  • Context
  • Cookie
  • Dialog
  • Events
  • Flag
  • History
  • Inline dialog
  • Jira
  • Navigator
  • Request
  • User

Flag

Flags are the primary method for providing system feedback in the product user interface. Messages include notifications of various kinds: alerts, confirmations, notices, warnings, info and errors.

Methods

create (options)

Creates a new flag.

Parameters

NameTypeDescription
optionsObject

Options of the flag.

Properties
NameTypeDefaultDescription
titleString

The title text of the flag.

bodyString

The body text of the flag.

typeStringinfo

Sets the type of the message. Valid options are "info", "success", "warning" and "error".

closeString

The closing behaviour that this flag has. Valid options are "manual", and "auto".

actionsObject

Map of {actionIdentifier: 'Action link text'} to add to the flag. The actionIdentifier will be passed to a 'flag.action' event if the link is clicked.

Returns

Flag~Flag

Example

1
2
3
4
5
6
7
8
9
// Display a nice green flag using the Flags JavaScript API.
var flag = AP.flag.create({
  title: 'Successfully created a flag.',
  body: 'This is a flag.',
  type: 'success',
  actions: {
    'actionkey': 'Click me'
  }
});

  • System status
  • Privacy
  • Developer Terms
  • Trademark
  • Cookie Preferences
  • © 2019 Atlassian