The following plugin provides functionality available through Pipeline-compatible steps. Read more about how to integrate steps into your Pipeline in the Steps section of the Pipeline Syntax page.

For a list of other such plugins, see the Pipeline Steps Reference page.

Badge

addBadge: Add Badge

Adds one or more badges to the current Pipeline build. Badges are symbols or icons with an optional text message and an optional clickable hyperlink. Badges are often used to provide a visual indicator of additional status information about a Pipeline build. Badges added by addBadge are displayed in the build history of the Pipeline job.

The plugin supports symbols from the ionicons library through the ionicons-api-plugin. More symbols can be added by installing additional plugins, such as font-awesome-api-plugin or custom-folder-icon-plugin. Symbols are referenced as "symbol-icon-name plugin-plugin-name". For example, the following are all valid references to symbols from the ionicons library:

  • addBadge icon: 'symbol-alert-circle-outline plugin-ionicons-api', text: 'This is an alert symbol'
  • addBadge icon: 'symbol-bar-chart-filled plugin-ionicons-api', text: 'This is a bar chart symbol'
  • addBadge icon: 'symbol-battery-half-sharp plugin-ionicons-api', text: 'This is a half filled battery symbol'
  • addBadge icon: 'symbol-flag-outline plugin-ionicons-api', text: 'This is a flag symbol'
  • addBadge icon: 'symbol-mic plugin-ionicons-api', text: 'This is a microphone symbol'
  • addBadge icon: 'symbol-rocket-filled plugin-ionicons-api', text: 'This is a rocket'
  • addBadge icon: 'symbol-unlink-sharp plugin-ionicons-api', text: 'This is an unlink symbol'

The plugin includes icons as GIF images and also supports the 16x16 icons that are offered by Jenkins. These icons are listed in the plugin documentation and are referenced as "image-name.gif". For example, the following are all valid references to icons included with the plugin:

  • addBadge icon: 'completed.gif', text: 'This is a completed symbol'
  • addBadge icon: 'delete.gif', text: 'This is a delete icon'
  • addBadge icon: 'save.gif', text: 'This is a save icon'
  • addBadge icon: 'success.gif', text: 'This is a success icon'
  • addBadge icon: 'warning.gif', text: 'This is a warning icon'

The Pipeline Syntax Snippet Generator guides the user to select badge options and provides online help for the options.

Example: Badge with completed icon

The following example adds a "completed" checkmark icon with the text, "This is completed":

addBadge icon: 'completed.gif', text: 'This is completed'

Example: Badge with alarm symbol

The following example adds an alarm badge in outline format with the text, "This is alarming":

addBadge icon: 'symbol-alarm-outline plugin-ionicons-api', text: 'This is alarming'

Example: Badge with red bug symbol

The following example adds a red bug badge with the text, "This is a red bug with a link", and a link to a bug report:

addBadge icon: 'symbol-bug plugin-ionicons-api',
         text: 'This is a red bug with a link',
	 color: 'red',
         link: 'https://issues.jenkins.io/browse/JENKINS-59646'

  • icon : String

    The plugin supports symbols from the ionicons library through the ionicons-api-plugin. More symbols can be added by installing additional plugins, such as font-awesome-api-plugin or custom-folder-icon-plugin. Symbols are referenced as "symbol-icon-name plugin-plugin-name". For example, the following are all valid references to symbols from the ionicons library:

    • addBadge icon: 'symbol-alert-circle-outline plugin-ionicons-api', text: 'This is an alert symbol'
    • addBadge icon: 'symbol-bar-chart-filled plugin-ionicons-api', text: 'This is a bar chart symbol'
    • addBadge icon: 'symbol-battery-half-sharp plugin-ionicons-api', text: 'This is a half filled battery symbol'
    • addBadge icon: 'symbol-flag-outline plugin-ionicons-api', text: 'This is a flag symbol'
    • addBadge icon: 'symbol-mic plugin-ionicons-api', text: 'This is a microphone symbol'
    • addBadge icon: 'symbol-rocket-filled plugin-ionicons-api', text: 'This is a rocket'
    • addBadge icon: 'symbol-unlink-sharp plugin-ionicons-api', text: 'This is an unlink symbol'

    The plugin supports the 16x16 icons that are offered by Jenkins. The plugin includes a group of icons as GIF images. Icons provided by the plugin are listed in the plugin documentation and are referenced as "image-name.gif". For example, the following are all valid references to icons included with the plugin:

    • addBadge icon: 'completed.gif', text: 'This is a completed symbol'
    • addBadge icon: 'delete.gif', text: 'This is a delete icon'
    • addBadge icon: 'save.gif', text: 'This is a save icon'
    • addBadge icon: 'success.gif', text: 'This is a success icon'
    • addBadge icon: 'warning.gif', text: 'This is a warning icon'

  • text : String
    Text that will be displayed to the user when they hover over the badge.
  • color : String (optional)
    The Jenkins color name or CSS color of the badge.

    The plugin supports colors from the Jenkins palette colors. For example, the following are all valid references to the Jenkins palette colors:

    • addBadge icon: 'symbol-star plugin-ionicons-api', text: 'A star', color: 'yellow'
    • addBadge icon: 'symbol-star plugin-ionicons-api', text: 'A star', color: 'dark-yellow'
    • addBadge icon: 'symbol-star plugin-ionicons-api', text: 'A star', color: 'jenkins-!-color-yellow'

    The plugin supports colors from the Jenkins semantic colors. For example, the following are all valid references to the Jenkins semantic colors:

    • addBadge(icon: 'symbol-star plugin-ionicons-api', text: 'A star', color: 'warning')
    • addBadge(icon: 'symbol-star plugin-ionicons-api', text: 'A star', color: 'success')

    The plugin also supports CSS colors for icons not from the Jenkins symbol library. For example, the following are all valid references to CSS colors:

    • addBadge icon: '/path/to/icon.svg', text: 'A star', color: '#7fffd4'
    • addBadge icon: '/path/to/icon.svg', text: 'A star', color: 'rgb(0, 0, 256)'

  • id : String (optional)
    Optional identifier for the badge in case later operations in the Pipeline job need to delete it. Most users do not need to assign an id for the badges that they create.
  • link : String (optional)
    URL of the hyperlink that will be opened when the user clicks the badge.

addErrorBadge: Add Error Badge

Adds an error badge to the current Pipeline build. An error badge uses the "error" symbol with a text message. Badges added by addErrorBadge are displayed in the build history of the Pipeline job.

The Pipeline Syntax Snippet Generator guides the user to select badge options and provides online help for the options.

Example: Badge with an error

The following example adds an "error" symbol with the text, "This is an error":

addErrorBadge text: 'This is an error'

  • text : String
    Text that will be displayed to the user when they hover over the badge.
  • id : String (optional)
    Optional identifier for the badge in case later operations in the Pipeline job need to delete it. Most users do not need to assign an id for the badges that they create.
  • link : String (optional)

addHtmlBadge: Add a html badge Text

  • html : String
    HTML markup that will be rendered for the user when they hover over the badge.
  • id : String (optional)
    Optional identifier for the badge in case later operations in the Pipeline job need to delete it. Most users do not need to assign an id for the badges that they create.

addInfoBadge: Add Info Badge

Adds an info badge to the current Pipeline build. An info badge uses the "info" symbol with a text message. Badges added by addInfoBadge are displayed in the build history of the Pipeline job.

The Pipeline Syntax Snippet Generator guides the user to select badge options and provides online help for the options.

Example: Badge with an info

The following example adds an "info" symbol with the text, "This is an info":

addInfoBadge text: 'This is an info'

  • text : String
    Text that will be displayed to the user when they hover over the badge.
  • id : String (optional)
    Optional identifier for the badge in case later operations in the Pipeline job need to delete it. Most users do not need to assign an id for the badges that they create.
  • link : String (optional)

addShortText: Add Short Text

  • text : String
    Text that will be displayed to the user when they hover over the badge.
  • background : String (optional)
  • border : int (optional)
  • borderColor : String (optional)
  • color : String (optional)
    The Jenkins color name or CSS color of the badge.

    The plugin supports colors from the Jenkins palette colors. For example, the following are all valid references to the Jenkins palette colors:

    • addShortText text: 'ok', color: 'green'
    • addShortText text: 'ok', color: 'dark-green'
    • addShortText text: 'ok', color: 'jenkins-!-color-green'

    The plugin supports colors from the Jenkins semantic colors. For example, the following are all valid references to the Jenkins semantic colors:

    • addShortText text: 'fail', color: 'error')
    • addShortText text: 'ok', color: 'success')

    The plugin also supports CSS colors. For example, the following are all valid references to CSS colors:

    • addShortText text: 'ok', color: '#42f557'
    • addShortText text: 'ok', color: 'rgb(66, 245, 87)'
    • addShortText text: 'ok', color: 'var(--green)' // jenkins css vars

  • link : String (optional)
    URL of the hyperlink that will be opened when the user clicks the badge.

addWarningBadge: Add Warning Badge

Adds a warning badge to the current Pipeline build. A warning badge uses the "warning" symbol with a text message. Badges added by addWarningBadge are displayed in the build history of the Pipeline job.

The Pipeline Syntax Snippet Generator guides the user to select badge options and provides online help for the options.

Example: Badge with a warning

The following example adds a "warning" symbol with the text, "This is a warning":

addWarningBadge text: 'This is a warning'

  • text : String
    Text that will be displayed to the user when they hover over the badge.
  • id : String (optional)
    Optional identifier for the badge in case later operations in the Pipeline job need to delete it. Most users do not need to assign an id for the badges that they create.
  • link : String (optional)

createSummary: Create Summary

  • icon : String
  • id : String (optional)
    Optional identifier for the badge in case later operations in the Pipeline job need to delete it. Most users do not need to assign an id for the badges that they create.
  • text : String (optional)

removeBadges: Remove Badges

  • id : String (optional)

removeHtmlBadges: Remove Html Badges

  • id : String (optional)

removeSummaries: Remove Summaries

  • id : String (optional)

Was this page helpful?

Please submit your feedback about this page through this quick form.

Alternatively, if you don't wish to complete the quick form, you can simply indicate if you found this page helpful?

    


See existing feedback here.