Bamboo Tasks API


Bamboo 3.1 and later

What is a Task?

A Task is an operation that is run sequentially within a Job on a Bamboo working directory. Once a Task is defined in the Bamboo system, it can then be specified in Jobs by a Plan administrator. A Job can be configured to execute a number of Tasks, on the same working directory. For example, before executing a Maven goal, the user could substitute specific files within the working directory, substitute version numbers or execute a Script.

Developing custom Tasks

Tasks are designed to be easy to implement and extend. The basic unit of a Task is a TaskType which is a simple interface that takes in some contextual information, such as a map of configuration strings, logging mechanisms and file system locations, executes an action then returns a result object containing a result state (success, failed, error, etc) and a map of result data. You can learn more about the API in our Tasks Overview and by reading the other materials provided below.

For an overview about how Tasks fit into Bamboo see the Bamboo Plugin Guide.

Example code

We are maintaining example code for each of the tutorials on a Mercurial repository hosted with Bitbucket. You can clone the repository by running the following command from a terminal or command prompt.

hg clone

All examples should work with the latest version of Bamboo and the Atlassian SDK.

Getting help

You can get help with all Bamboo APIs by asking a question on Atlassian Answers. Don't forget to tag your question with bamboo and bamboo-development.


Tasks Overview

In this overview of the Task APIs we highlight how Tasks are executed, defined, configured and how to use optional APIs such as Executables, Test Parsing, Logging, Capabilities, Requirements and design considerations for running Tasks on Remote Agents

Introduction to writing Tasks

In this tutorial we explain the basic elements of the Bamboo Task API, including logging and setting an applicable result state

Writing a Task with a User Interface

The Bamboo "Hello World" plugin is the example Bamboo plugin that ships with the Atlassian Plugin SDK default project. In this tutorial we break down the plugin and explain how to build a User Interface and add validation.

Executing external Processes using ProcessService

ProcessService is a bean which can be injected into a TaskType to execute external processes.

Test Collection and Reporting

Using the TestCollationService APIs its possible to write your own Tasks that parse files or logs that contain test results and have the results display in Bamboo.

Providing an icon for your Bamboo Task

In Bamboo 3.4 and above, it is possible to give your Task plugin an easily identifiable icon when a user browses for Tasks.

Providing help links for your Bamboo Task

In Bamboo 5.2 and above, it is possible to add a link to help documentation for your task, which displays in the top right corner of the task edit window.

Was this page helpful?

Have a question about this article?

See questions about this article

Powered by Confluence and Scroll Viewport