Ask or search…

Search Project Boards

In this article, I would be showing you how to extract the boards associated with a Jira project using go-atlassian

Step 1: Create a new Go project

Create a new directory for your project and navigate to it in your terminal or command prompt. Initialize a new Go module using the following command:
go mod init your-module-name

Step 2: Install the "go-atlassian" library

To use the "go-atlassian" library, you need to install it as a dependency in your project. Run the following command:
go get

Step 3: Import the required packages

Create a new Go file, e.g., main.go, and import the necessary packages:
package main
import (
jira ""

Step 4: Set up Jira Agile API client

Initialize the Jira Agile API client with your Jira base URL and API token:
func main() {
jiraClient, err := jira.New(nil, "")
if err != nil {
// Set API token for authentication
jiraClient.Auth.SetBasicAuth(mail, token)

Step 5: Extract the boards

In this step, you're going to use the Jira Agile API, more specifically, the Board service, Gets() method. This methods supports multiple query parameters, but in this example, we're going to use the ProjectKeyOrID param to filter the board linked to a Jira project.
The following example iterates the Board.Gets() method and appends the boards into a slice.
options := &models.GetBoardsOptions{
ProjectKeyOrID: "KP",
var boards []*models.BoardScheme
var startAt int
for {
fmt.Println("Pagination #", startAt)
page, response, err := instance.Board.Gets(context.Background(), options, startAt, 50)
if err != nil {
if response != nil {
boards = append(boards, page.Values...)
if page.IsLast {
startAt = +50