All notable changes to this project will be documented in this file. See standard-version for commit guidelines.
2.0 (UNRELEASED)
Version 2.0 is a bigger change with the main goal to make this library more reliable and future safe. See andygrunwald#489 for details.
We moved from 1 client that handles On-Premise and Cloud to 2 clients that handle either On-Premise or Cloud. Previously you used this library like:
import (
"github.com/andygrunwald/go-jira"
)
In the new version, you need to decide if you interact with the Jira On-Premise or Jira Cloud version. For the cloud version, you will import this library like
import (
jira "github.com/andygrunwald/go-jira/cloud"
)
For On-Premise it looks like
import (
jira "github.com/andygrunwald/go-jira/onpremise"
)
The order of arguments in the jira.NewClient
has changed:
- The base URL of your JIRA instance
- A HTTP client (optional)
Before:
jira.NewClient(nil, "https://issues.apache.org/jira/")
After:
jira.NewClient("https://issues.apache.org/jira/", nil)
The client will identify itself via a UserAgent go-jira/2.0.0
.
The function client.NewRawRequestWithContext()
has been removed.
client.NewRawRequest()
accepts now a context as the first argument.
This is a drop in replacement.
Before:
client.NewRawRequestWithContext(context.Background(), "GET", .....)
After:
client.NewRawRequest(context.Background(), "GET", .....)
For people who used jira.NewRawRequest()
: You need to pass a context as the first argument.
Like
client.NewRawRequest(context.Background(), "GET", .....)
The function client.NewRequestWithContext()
has been removed.
client.NewRequest()
accepts now a context as the first argument.
This is a drop in replacement.
Before:
client.NewRequestWithContext(context.Background(), "GET", .....)
After:
client.NewRequest(context.Background(), "GET", .....)
For people who used jira.NewRequest()
: You need to pass a context as the first argument.
Like
client.NewRequest(context.Background(), "GET", .....)
The function client.NewMultiPartRequestWithContext()
has been removed.
client.NewMultiPartRequest()
accepts now a context as the first argument.
This is a drop in replacement.
Before:
client.NewMultiPartRequestWithContext(context.Background(), "GET", .....)
After:
client.NewMultiPartRequest(context.Background(), "GET", .....)
For people who used jira.NewMultiPartRequest()
: You need to pass a context as the first argument.
Like
client.NewMultiPartRequest(context.Background(), "GET", .....)
All API methods require a context
as first argument.
In the v1, some methods had a ...WithContext
suffix.
These methods have been removed.
If you used a service like
client.Issue.CreateWithContext(ctx, ...)
the new call would be
client.Issue.Create(ctx, ...)
If you used API calls without a context, like
client.Issue.Create(...)
the new call would be
client.Issue.Create(ctx, ...)
The function client.BoardService.GetAllSprintsWithOptions()
has been renamed to client.BoardService.GetAllSprints()
.
Before:
client.Board.GetAllSprints(context.Background(), "123")
After:
client.Board.GetAllSprints(context.Background(), "123", nil)
Before:
client.Board.GetAllSprintsWithOptions(context.Background(), 123, &GetAllSprintsOptions{State: "active,future"})
After:
client.Board.GetAllSprints(context.Background(), 123, &GetAllSprintsOptions{State: "active,future"})
The function client.GroupService.GetWithOptions()
has been renamed to client.GroupService.Get()
.
Before:
client.Group.Get(context.Background(), "default")
After:
client.Group.Get(context.Background(), "default", nil)
Before:
client.Group.GetWithOptions(context.Background(), "default", &GroupSearchOptions{StartAt: 0, MaxResults: 2})
After:
client.Group.Get(context.Background(), "default", &GroupSearchOptions{StartAt: 0, MaxResults: 2})
The function client.Issue.UpdateWithOptions()
has been renamed to client.Issue.Update()
.
Before:
client.Issue.Update(context.Background(), issue)
After:
client.Issue.Update(context.Background(), issue, nil)
Before:
client.Issue.UpdateWithOptions(context.Background(), issue, nil)
After:
client.Issue.Update(context.Background(), issue, nil)
The function client.Issue.GetCreateMetaWithOptions()
has been renamed to client.Issue.GetCreateMeta()
.
Before:
client.Issue.GetCreateMeta(context.Background(), "SPN")
After:
client.Issue.GetCreateMetaWithOptions(ctx, &GetQueryOptions{ProjectKeys: "SPN", Expand: "projects.issuetypes.fields"})
Before:
client.Issue.GetCreateMetaWithOptions(ctx, &GetQueryOptions{ProjectKeys: "SPN", Expand: "projects.issuetypes.fields"})
After:
client.Issue.GetCreateMeta(ctx, &GetQueryOptions{ProjectKeys: "SPN", Expand: "projects.issuetypes.fields"})
The function client.Project.ListWithOptions()
has been renamed to client.Project.GetAll()
.
Before:
client.Project.GetList(context.Background())
After:
client.Project.GetAll(context.Background(), nil)
Before:
client.Project.ListWithOptions(ctx, &GetQueryOptions{})
After:
client.Project.GetAll(ctx, &GetQueryOptions{})
If you used BearerAuthTransport
or PATAuthTransport
for authentication, please replace it with BasicAuthTransport
.
Before:
tp := jira.BearerAuthTransport{
Token: "token",
}
client, err := jira.NewClient("https://...", tp.Client())
or
tp := jira.PATAuthTransport{
Token: "token",
}
client, err := jira.NewClient("https://...", tp.Client())
After:
tp := jira.BasicAuthTransport{
Username: "username",
APIToken: "token",
}
client, err := jira.NewClient("https://...", tp.Client())
Before:
tp := jira.BasicAuthTransport{
Username: "username",
Password: "token",
}
client, err := jira.NewClient("https://...", tp.Client())
After:
tp := jira.BasicAuthTransport{
Username: "username",
APIToken: "token",
}
client, err := jira.NewClient("https://...", tp.Client())
- Jira On-Premise and Jira Cloud have now different clients, because the API differs
client.NewRawRequestWithContext()
has been removed in favor ofclient.NewRawRequest()
, which requires now a context as first argumentclient.NewRequestWithContext()
has been removed in favor ofclient.NewRequest()
, which requires now a context as first argumentclient.NewMultiPartRequestWithContext()
has been removed in favor ofclient.NewMultiPartRequest()
, which requires now a context as first argumentcontext
is now a first class citizen in all API calls. Functions that had a suffix like...WithContext
have been removed entirely. The API methods support the context now as first argument.BoardService.GetAllSprints
has been removed andBoardService.GetAllSprintsWithOptions
has been renamed toBoardService.GetAllSprints
GroupService.Get
has been removed andGroupService.GetWithOptions
has been renamed toGroupService.Get
Issue.Update
has been removed andIssue.UpdateWithOptions
has been renamed toIssue.Update
Issue.GetCreateMeta
has been removed andIssue.GetCreateMetaWithOptions
has been renamed toIssue.GetCreateMeta
Project.GetList
has been removed andProject.ListWithOptions
has been renamed toProject.GetAll
- Cloud/Authentication: Removed
BearerAuthTransport
, because it was a (kind of) duplicate ofBasicAuthTransport
- Cloud/Authentication: Removed
PATAuthTransport
, because it was a (kind of) duplicate ofBasicAuthTransport
- Cloud/Authentication:
BasicAuthTransport.Password
was renamed toBasicAuthTransport.APIToken
- Cloud/Authentication: Removes
CookieAuthTransport
andAuthenticationService
, because this type of auth is not supported by the Jira cloud offering - Cloud/Component: The type
CreateComponentOptions
was renamed toComponentCreateOptions
- Cloud/User: Renamed
User.GetSelf
toUser.GetCurrentUser
- Cloud/Group: Renamed
Group.Add
toGroup.AddUserByGroupName
- Cloud/Group: Renamed
Group.Remove
toGroup.RemoveUserByGroupName
- UserAgent: Client HTTP calls are now identifable via a User Agent. This user agent can be configured (default:
go-jira/2.0.0
) - The underlying used HTTP client for API calls can be retrieved via
client.Client()
- API-Version: Official support for Jira Cloud API in version 3
- README: Fixed all (broken) links
- Workflow status categories: Revisited and fully implemented for Cloud and On Premise (incl. examples)
- Replace all "GET", "POST", ... with http.MethodGet (and related) constants
- Development: Added
make
commands to collect (unit) test coverage - Internal: Replaced
io.ReadAll
andjson.Unmarshal
withjson.NewDecoder
1.13.0 (2020-10-25)
- add AddRemoteLink method (f200e15), closes /developer.atlassian.com/cloud/jira/platform/rest/v2/#api-rest-api-2
- Add Names support on Issue struct (#278) (1fc10e0)
- Extend Makefile for more source code quality targets (5e52236)
- context: Add support for context package (e1f4265)
- issues: Add GetEditMeta on issue (a783764), closes /docs.atlassian.com/DAC/rest/jira/6.1.html#d2e1364
- IssueService: allow empty JQL (#268) (4b91cf2)
- project: Add cronjob to check for stale issues (#287) (2096b04)
- project: Add GitHub Actions testing workflow (#289) (80c0282), closes #290
- project: Add workflow to greet new contributors (#288) (c357b61)
- change millisecond time format (8c77107)
- paging with load balancer going to endless loop (19d3fc0), closes #260
- issue: IssueService.Search() with a not empty JQL triggers 400 bad request (#292) (8b64c7f), closes #291
- IssueService.GetWatchers: UserService.GetByAccountID support accountId params (436469b)
- product: Make product naming consistent, rename JIRA to Jira (#286) (146229d), closes #284
- tests: Fix TestIssueService_PostAttachment unit test (f6b1dca)
- removing the use of username field in searching for users (#297) (f50cb07)
1.12.0 (2019-12-14)
- Add IssueLinkTypeService with GetList and test (261889a)
- add worklog update method (9ff562a)
- Implement get remote links method (1946cac)
- Implement issue link type DELETE (e37cc6c)
- Implement issue link type GET (57538b9)
- Implement issue link type POST (75b9df8)
- Implement issue link type PUT (48a15c1)
- provide access to issue transitions loaded from JIRA API (7530b7c)
1.11.1 (2019-10-17)
1.11.0 (2019-10-17)
- Add AccountID and AccountType to GroupMember struct (216e005)
- Add AccountType and Locale to User struct (52ab347)
- Add GetAllStatuses (afc96b1)
- Add GetMyFilters to FilterService (ebae19d)
- Add Search to FilterService (38a755b)
- add support for JWT auth with qsh needed by add-ons (a8bdfed)
- AddGetBoardConfiguration (fd698c5)
- Replace http.Client with interface for extensibility (b59a65c)
1.10.0 (2019-05-23)
- empty SearchOptions causing malformed request (b3bf8c2)
- added DeleteAttachment (e93c0e1)
1.9.0 (2019-05-19)
- issues: Added support for AddWorklog and GetWorklogs (1ebd7e7)
1.8.0 (2019-05-16)
- Add PriorityService to the main (8491cb0)