Skip to content

Latest commit

 

History

History
525 lines (345 loc) · 18.2 KB

CHANGELOG.md

File metadata and controls

525 lines (345 loc) · 18.2 KB

Changelog

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 #489 for details.

Migration

Split of clients

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"
)

Init a new client

The order of arguments in the jira.NewClient has changed:

  1. The base URL of your JIRA instance
  2. A HTTP client (optional)

Before:

jira.NewClient(nil, "https://issues.apache.org/jira/")

After:

jira.NewClient("https://issues.apache.org/jira/", nil)

User Agent

The client will identify itself via a UserAgent go-jira/2.0.0.

NewRawRequestWithContext removed, NewRawRequest requires context

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", .....)

NewRequestWithContext removed, NewRequest requires context

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", .....)

NewMultiPartRequestWithContext removed, NewMultiPartRequest requires context

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", .....)

context is a first class citizen

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, ...)

BoardService.GetAllSprints removed, BoardService.GetAllSprintsWithOptions renamed

The function client.BoardService.GetAllSprintsWithOptions() has been renamed to client.BoardService.GetAllSprints().

If you used client.BoardService.GetAllSprints():

Before:

client.Board.GetAllSprints(context.Background(), "123")

After:

client.Board.GetAllSprints(context.Background(), "123", nil)
If you used client.BoardService.GetAllSprintsWithOptions():

Before:

client.Board.GetAllSprintsWithOptions(context.Background(), 123, &GetAllSprintsOptions{State: "active,future"})

After:

client.Board.GetAllSprints(context.Background(), 123, &GetAllSprintsOptions{State: "active,future"})

GroupService.Get removed, GroupService.GetWithOptions renamed

The function client.GroupService.GetWithOptions() has been renamed to client.GroupService.Get().

If you used client.GroupService.Get():

Before:

client.Group.Get(context.Background(), "default")

After:

client.Group.Get(context.Background(), "default", nil)
If you used client.GroupService.GetWithOptions():

Before:

client.Group.GetWithOptions(context.Background(), "default", &GroupSearchOptions{StartAt: 0, MaxResults: 2})

After:

client.Group.Get(context.Background(), "default", &GroupSearchOptions{StartAt: 0, MaxResults: 2})

Issue.Update removed, Issue.UpdateWithOptions renamed

The function client.Issue.UpdateWithOptions() has been renamed to client.Issue.Update().

If you used client.Issue.Update():

Before:

client.Issue.Update(context.Background(), issue)

After:

client.Issue.Update(context.Background(), issue, nil)
If you used client.Issue.UpdateWithOptions():

Before:

client.Issue.UpdateWithOptions(context.Background(), issue, nil)

After:

client.Issue.Update(context.Background(), issue, nil)

Issue.GetCreateMeta removed, Issue.GetCreateMetaWithOptions renamed

The function client.Issue.GetCreateMetaWithOptions() has been renamed to client.Issue.GetCreateMeta().

If you used client.Issue.GetCreateMeta():

Before:

client.Issue.GetCreateMeta(context.Background(), "SPN")

After:

client.Issue.GetCreateMetaWithOptions(ctx, &GetQueryOptions{ProjectKeys: "SPN", Expand: "projects.issuetypes.fields"})
If you used client.Issue.GetCreateMetaWithOptions():

Before:

client.Issue.GetCreateMetaWithOptions(ctx, &GetQueryOptions{ProjectKeys: "SPN", Expand: "projects.issuetypes.fields"})

After:

client.Issue.GetCreateMeta(ctx, &GetQueryOptions{ProjectKeys: "SPN", Expand: "projects.issuetypes.fields"})

Project.GetList removed, Project.ListWithOptions renamed

The function client.Project.ListWithOptions() has been renamed to client.Project.GetAll().

If you used client.Project.GetList():

Before:

client.Project.GetList(context.Background())

After:

client.Project.GetAll(context.Background(), nil)
If you used client.Project.ListWithOptions():

Before:

client.Project.ListWithOptions(ctx, &GetQueryOptions{})

After:

client.Project.GetAll(ctx, &GetQueryOptions{})

Cloud/Authentication: BearerAuthTransport removed, PATAuthTransport removed

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())

Cloud/Authentication: BasicAuthTransport.Password was renamed to BasicAuthTransport.APIToken

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())

Breaking changes

  • Jira On-Premise and Jira Cloud have now different clients, because the API differs
  • client.NewRawRequestWithContext() has been removed in favor of client.NewRawRequest(), which requires now a context as first argument
  • client.NewRequestWithContext() has been removed in favor of client.NewRequest(), which requires now a context as first argument
  • client.NewMultiPartRequestWithContext() has been removed in favor of client.NewMultiPartRequest(), which requires now a context as first argument
  • context 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 and BoardService.GetAllSprintsWithOptions has been renamed to BoardService.GetAllSprints
  • GroupService.Get has been removed and GroupService.GetWithOptions has been renamed to GroupService.Get
  • Issue.Update has been removed and Issue.UpdateWithOptions has been renamed to Issue.Update
  • Issue.GetCreateMeta has been removed and Issue.GetCreateMetaWithOptions has been renamed to Issue.GetCreateMeta
  • Project.GetList has been removed and Project.ListWithOptions has been renamed to Project.GetAll
  • Cloud/Authentication: Removed BearerAuthTransport, because it was a (kind of) duplicate of BasicAuthTransport
  • Cloud/Authentication: Removed PATAuthTransport, because it was a (kind of) duplicate of BasicAuthTransport
  • Cloud/Authentication: BasicAuthTransport.Password was renamed to BasicAuthTransport.APIToken
  • Cloud/Authentication: Removes CookieAuthTransport and AuthenticationService, because this type of auth is not supported by the Jira cloud offering
  • Cloud/Component: The type CreateComponentOptions was renamed to ComponentCreateOptions
  • Cloud/User: Renamed User.GetSelf to User.GetCurrentUser
  • Cloud/Group: Renamed Group.Add to Group.AddUserByGroupName
  • Cloud/Group: Renamed Group.Remove to Group.RemoveUserByGroupName

Features

  • 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

Bug Fixes

  • README: Fixed all (broken) links

API-Endpoints

  • Workflow status categories: Revisited and fully implemented for Cloud and On Premise (incl. examples)

Other

  • Replace all "GET", "POST", ... with http.MethodGet (and related) constants
  • Development: Added make commands to collect (unit) test coverage
  • Internal: Replaced io.ReadAll and json.Unmarshal with json.NewDecoder

Changes

1.13.0 (2020-10-25)

Features

Bug Fixes

  • 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)

Features

  • 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)

Features

  • 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)

Bug Fixes

  • Fix fixversion description tag (8383e2f)
  • Fix typos in filter_test.go (e9a261c)

1.10.0 (2019-05-23)

Bug Fixes

  • empty SearchOptions causing malformed request (b3bf8c2)

Features

1.9.0 (2019-05-19)

Features

  • issues: Added support for AddWorklog and GetWorklogs (1ebd7e7)

1.8.0 (2019-05-16)

Bug Fixes

  • Add PriorityService to the main (8491cb0)

Features

  • filter: Add GetFavouriteList to FilterService. (645898e)
  • Add get all priorities (1c63e25)
  • Add ResolutionService to retrieve resolutions (fb1ce22)
  • Add status category constants (6223ddd)
  • Add StatusCategory GetList (049a756)