πŸ“‰
Boards
A board displays issues from one or more projects, giving you a flexible way of viewing, managing, and reporting on work in progress.

Get issues for backlog

Returns all issues from the board's backlog, for the given board ID.
  • This only includes issues that the user has permission to view.
  • The backlog contains incomplete issues that are not assigned to any future or active sprint.
Note, if the user does not have permission to view the board, no issues will be returned at all.
Issues returned from this resource include Agile fields, like sprint, closedSprints, flagged, and epic. By default, the returned issues are ordered by rank.
The Jira Software Cloud REST API
Official Documentation
1
package main
2
​
3
import (
4
"context"
5
"github.com/ctreminiom/go-atlassian/jira/agile"
6
"github.com/ctreminiom/go-atlassian/pkg/infra/models"
7
"log"
8
"os"
9
)
10
​
11
func main() {
12
​
13
var (
14
host = os.Getenv("HOST")
15
mail = os.Getenv("MAIL")
16
token = os.Getenv("TOKEN")
17
)
18
​
19
atlassian, err := agile.New(nil, host)
20
if err != nil {
21
return
22
}
23
​
24
atlassian.Auth.SetBasicAuth(mail, token)
25
atlassian.Auth.SetUserAgent("curl/7.54.0")
26
​
27
var (
28
options = &models.IssueOptionScheme{
29
JQL: "project = KP",
30
ValidateQuery: true,
31
Fields: []string{"status", "issuetype", "summary"},
32
Expand: []string{"changelog"},
33
}
34
​
35
boardID = 4
36
startAt = 0
37
maxResult = 50
38
)
39
​
40
issues, response, err := atlassian.Board.Backlog(context.Background(), boardID, startAt, maxResult, options)
41
if err != nil {
42
if response != nil {
43
log.Println("Response HTTP Response", string(response.Bytes.Bytes()))
44
}
45
log.Fatal(err)
46
}
47
​
48
log.Println("Response HTTP Code", response.Code)
49
log.Println("HTTP Endpoint Used", response.Endpoint)
50
​
51
for _, issue := range issues.Issues {
52
log.Println(issue.Key)
53
}
54
}
Copied!

Get configuration

Get the board configuration.
The Jira Software Cloud REST API
Official Documentation
1
package main
2
​
3
import (
4
"context"
5
"github.com/ctreminiom/go-atlassian/jira/agile"
6
"log"
7
"os"
8
)
9
​
10
func main() {
11
​
12
var (
13
host = os.Getenv("HOST")
14
mail = os.Getenv("MAIL")
15
token = os.Getenv("TOKEN")
16
)
17
​
18
atlassian, err := agile.New(nil, host)
19
if err != nil {
20
return
21
}
22
​
23
atlassian.Auth.SetBasicAuth(mail, token)
24
atlassian.Auth.SetUserAgent("curl/7.54.0")
25
​
26
boardConfig, response, err := atlassian.Board.Configuration(context.Background(), 4)
27
if err != nil {
28
if response != nil {
29
log.Println("Response HTTP Response", response.Bytes.String())
30
}
31
log.Fatal(err)
32
}
33
​
34
log.Println("Response HTTP Code", response.Code)
35
log.Println("HTTP Endpoint Used", response.Endpoint)
36
log.Println(boardConfig)
37
}
Copied!

Create board

Creates a new board. Board name, type ,and filter ID is required
The Jira Software Cloud REST API
Official Documentation
1
package main
2
​
3
import (
4
"context"
5
"github.com/ctreminiom/go-atlassian/jira/agile"
6
"github.com/ctreminiom/go-atlassian/pkg/infra/models"
7
"log"
8
"os"
9
)
10
​
11
func main() {
12
​
13
var (
14
host = os.Getenv("HOST")
15
mail = os.Getenv("MAIL")
16
token = os.Getenv("TOKEN")
17
)
18
​
19
atlassian, err := agile.New(nil, host)
20
if err != nil {
21
return
22
}
23
​
24
atlassian.Auth.SetBasicAuth(mail, token)
25
atlassian.Auth.SetUserAgent("curl/7.54.0")
26
​
27
newBoard := &models.BoardPayloadScheme{
28
Name: "DUMMY Board Name",
29
Type: "scrum", //scrum or kanban
30
FilterID: 10016,
31
​
32
// Omit the Location if you want to the board to yourself (location)
33
Location: &models.BoardPayloadLocationScheme{
34
ProjectKeyOrID: "KP",
35
Type: "project",
36
},
37
}
38
​
39
board, response, err := atlassian.Board.Create(context.Background(), newBoard)
40
if err != nil {
41
if response != nil {
42
log.Println("Response HTTP Response", response.Bytes.String())
43
}
44
log.Fatal(err)
45
}
46
​
47
log.Println("Response HTTP Code", response.Code)
48
log.Println("HTTP Endpoint Used", response.Endpoint)
49
log.Println(board)
50
}
51
​
Copied!

Get epics

Returns all epics from the board, for the given board ID. This only includes epics that the user has permission to view. Note, if the user does not have permission to view the board, no epics will be returned at all.

Get board by filter id

Returns any boards which use the provided filter id. This method can be executed by users without a valid software license in order to find which boards are using a particular filter.

Get board

Returns the board for the given board ID. This board will only be returned if the user has permission to view it. Admins without the view permission will see the board as a private one, so will see only a subset of the board's data (board location for instance).

Get issues for board

Returns all issues from a board, for a given board ID. This only includes issues that the user has permission to view. An issue belongs to the board if its status is mapped to the board's column. Epic issues do not belongs to the scrum boards. Note, if the user does not have permission to view the board, no issues will be returned at all. Issues returned from this resource include Agile fields, like sprint, closedSprints, flagged, and epic. By default, the returned issues are ordered by rank.

Get board issues for epic

Returns all issues that belong to an epic on the board, for the given epic ID and the board ID. This only includes issues that the user has permission to view. Issues returned from this resource include Agile fields, like sprint, closedSprints, flagged, and epic. By default, the returned issues are ordered by rank.

Get board issues for sprint

Get all issues you have access to that belong to the sprint from the board. Issue returned from this resource contains additional fields like: sprint, closedSprints, flagged and epic. Issues are returned ordered by rank. JQL order has higher priority than default rank.

Get issues without epic for board

Returns all issues that do not belong to any epic on a board, for a given board ID. This only includes issues that the user has permission to view. Issues returned from this resource include Agile fields, like sprint, closedSprints, flagged, and epic. By default, the returned issues are ordered by rank.

Move issues to backlog for board

Move issues to the backlog of a particular board (if they are already on that board). This operation is equivalent to remove future and active sprints from a given set of issues if the board has sprints If the board does not have sprints this will put the issues back into the backlog from the board. At most 50 issues may be moved at once.

Get projects

Returns all projects that are associated with the board, for the given board ID. If the user does not have permission to view the board, no projects will be returned at all. Returned projects are ordered by the name.

Get all sprints

Returns all sprints from a board, for a given board ID. This only includes sprints that the user has permission to view.

Get all versions

Returns all versions from a board, for a given board ID. This only includes versions that the user has permission to view. Note, if the user does not have permission to view the board, no versions will be returned at all. Returned versions are ordered by the name of the project from which they belong and then by sequence defined by user.