Skip to content

Commit 146229d

Browse files
authored
fix(product): Make product naming consistent, rename JIRA to Jira (#286)
Atlassian names the product "Jira". In this library, the product name is used different (JIRA) and inconsistent (sometimes JIRA, sometimes Jira). closes issue #284
1 parent f6b1dca commit 146229d

25 files changed

+239
-239
lines changed

README.md

+13-13
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,23 @@
44
[![Build Status](https://travis-ci.org/andygrunwald/go-jira.svg?branch=master)](https://travis-ci.org/andygrunwald/go-jira)
55
[![Go Report Card](https://goreportcard.com/badge/github.com/andygrunwald/go-jira)](https://goreportcard.com/report/github.com/andygrunwald/go-jira)
66

7-
[Go](https://golang.org/) client library for [Atlassian JIRA](https://www.atlassian.com/software/jira).
7+
[Go](https://golang.org/) client library for [Atlassian Jira](https://www.atlassian.com/software/jira).
88

9-
![Go client library for Atlassian JIRA](./img/logo_small.png "Go client library for Atlassian JIRA.")
9+
![Go client library for Atlassian Jira](./img/logo_small.png "Go client library for Atlassian Jira.")
1010

1111
## Features
1212

1313
* Authentication (HTTP Basic, OAuth, Session Cookie)
1414
* Create and retrieve issues
1515
* Create and retrieve issue transitions (status updates)
16-
* Call every API endpoint of the JIRA, even if it is not directly implemented in this library
16+
* Call every API endpoint of the Jira, even if it is not directly implemented in this library
1717

18-
This package is not JIRA API complete (yet), but you can call every API endpoint you want. See [Call a not implemented API endpoint](#call-a-not-implemented-api-endpoint) how to do this. For all possible API endpoints of JIRA have a look at [latest JIRA REST API documentation](https://docs.atlassian.com/jira/REST/latest/).
18+
This package is not Jira API complete (yet), but you can call every API endpoint you want. See [Call a not implemented API endpoint](#call-a-not-implemented-api-endpoint) how to do this. For all possible API endpoints of Jira have a look at [latest Jira REST API documentation](https://docs.atlassian.com/jira/REST/latest/).
1919

2020
## Requirements
2121

2222
* Go >= 1.8
23-
* JIRA v6.3.4 & v7.1.2.
23+
* Jira v6.3.4 & v7.1.2.
2424

2525
## Installation
2626

@@ -52,7 +52,7 @@ go test -v ./...
5252

5353
Please have a look at the [GoDoc documentation](https://godoc.org/github.com/andygrunwald/go-jira) for a detailed API description.
5454

55-
The [latest JIRA REST API documentation](https://docs.atlassian.com/jira/REST/latest/) was the base document for this package.
55+
The [latest Jira REST API documentation](https://docs.atlassian.com/jira/REST/latest/) was the base document for this package.
5656

5757
## Examples
5858

@@ -113,12 +113,12 @@ func main() {
113113

114114
#### Authenticate with session cookie [DEPRECATED]
115115

116-
JIRA [deprecated this authentication method.](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-basic-auth-and-cookie-based-auth/) It's not longer available for use.
116+
Jira [deprecated this authentication method.](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-basic-auth-and-cookie-based-auth/) It's not longer available for use.
117117

118118

119119
#### Authenticate with OAuth
120120

121-
If you want to connect via OAuth to your JIRA Cloud instance checkout the [example of using OAuth authentication with JIRA in Go](https://gist.github.com/Lupus/edafe9a7c5c6b13407293d795442fe67) by [@Lupus](https://github.com/Lupus).
121+
If you want to connect via OAuth to your Jira Cloud instance checkout the [example of using OAuth authentication with Jira in Go](https://gist.github.com/Lupus/edafe9a7c5c6b13407293d795442fe67) by [@Lupus](https://github.com/Lupus).
122122

123123
For more details have a look at the [issue #56](https://github.com/andygrunwald/go-jira/issues/56).
124124

@@ -175,9 +175,9 @@ func main() {
175175

176176
### Call a not implemented API endpoint
177177

178-
Not all API endpoints of the JIRA API are implemented into *go-jira*.
178+
Not all API endpoints of the Jira API are implemented into *go-jira*.
179179
But you can call them anyway:
180-
Lets get all public projects of [Atlassian`s JIRA instance](https://jira.atlassian.com/).
180+
Lets get all public projects of [Atlassian`s Jira instance](https://jira.atlassian.com/).
181181

182182
```go
183183
package main
@@ -209,7 +209,7 @@ func main() {
209209

210210
// ...
211211
// BAM: Bamboo
212-
// BAMJ: Bamboo JIRA Plugin
212+
// BAMJ: Bamboo Jira Plugin
213213
// CLOV: Clover
214214
// CONF: Confluence
215215
// ...
@@ -218,15 +218,15 @@ func main() {
218218

219219
## Implementations
220220

221-
* [andygrunwald/jitic](https://github.com/andygrunwald/jitic) - The JIRA Ticket Checker
221+
* [andygrunwald/jitic](https://github.com/andygrunwald/jitic) - The Jira Ticket Checker
222222

223223
## Code structure
224224

225225
The code structure of this package was inspired by [google/go-github](https://github.com/google/go-github).
226226

227227
There is one main part (the client).
228228
Based on this main client the other endpoints, like Issues or Authentication are extracted in services. E.g. `IssueService` or `AuthenticationService`.
229-
These services own a responsibility of the single endpoints / usecases of JIRA.
229+
These services own a responsibility of the single endpoints / usecases of Jira.
230230

231231
## Contribution
232232

authentication.go

+11-11
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ const (
1515
authTypeSession = 2
1616
)
1717

18-
// AuthenticationService handles authentication for the JIRA instance / API.
18+
// AuthenticationService handles authentication for the Jira instance / API.
1919
//
20-
// JIRA API docs: https://docs.atlassian.com/jira/REST/latest/#authentication
20+
// Jira API docs: https://docs.atlassian.com/jira/REST/latest/#authentication
2121
type AuthenticationService struct {
2222
client *Client
2323

@@ -31,7 +31,7 @@ type AuthenticationService struct {
3131
password string
3232
}
3333

34-
// Session represents a Session JSON response by the JIRA API.
34+
// Session represents a Session JSON response by the Jira API.
3535
type Session struct {
3636
Self string `json:"self,omitempty"`
3737
Name string `json:"name,omitempty"`
@@ -48,13 +48,13 @@ type Session struct {
4848
Cookies []*http.Cookie
4949
}
5050

51-
// AcquireSessionCookieWithContext creates a new session for a user in JIRA.
52-
// Once a session has been successfully created it can be used to access any of JIRA's remote APIs and also the web UI by passing the appropriate HTTP Cookie header.
51+
// AcquireSessionCookieWithContext creates a new session for a user in Jira.
52+
// Once a session has been successfully created it can be used to access any of Jira's remote APIs and also the web UI by passing the appropriate HTTP Cookie header.
5353
// The header will by automatically applied to every API request.
5454
// Note that it is generally preferrable to use HTTP BASIC authentication with the REST API.
55-
// However, this resource may be used to mimic the behaviour of JIRA's log-in page (e.g. to display log-in errors to a user).
55+
// However, this resource may be used to mimic the behaviour of Jira's log-in page (e.g. to display log-in errors to a user).
5656
//
57-
// JIRA API docs: https://docs.atlassian.com/jira/REST/latest/#auth/1/session
57+
// Jira API docs: https://docs.atlassian.com/jira/REST/latest/#auth/1/session
5858
//
5959
// Deprecated: Use CookieAuthTransport instead
6060
func (s *AuthenticationService) AcquireSessionCookieWithContext(ctx context.Context, username, password string) (bool, error) {
@@ -99,7 +99,7 @@ func (s *AuthenticationService) AcquireSessionCookie(username, password string)
9999
return s.AcquireSessionCookieWithContext(context.Background(), username, password)
100100
}
101101

102-
// SetBasicAuth sets username and password for the basic auth against the JIRA instance.
102+
// SetBasicAuth sets username and password for the basic auth against the Jira instance.
103103
//
104104
// Deprecated: Use BasicAuthTransport instead
105105
func (s *AuthenticationService) SetBasicAuth(username, password string) {
@@ -108,7 +108,7 @@ func (s *AuthenticationService) SetBasicAuth(username, password string) {
108108
s.authType = authTypeBasic
109109
}
110110

111-
// Authenticated reports if the current Client has authentication details for JIRA
111+
// Authenticated reports if the current Client has authentication details for Jira
112112
func (s *AuthenticationService) Authenticated() bool {
113113
if s != nil {
114114
if s.authType == authTypeSession {
@@ -123,7 +123,7 @@ func (s *AuthenticationService) Authenticated() bool {
123123

124124
// LogoutWithContext logs out the current user that has been authenticated and the session in the client is destroyed.
125125
//
126-
// JIRA API docs: https://docs.atlassian.com/jira/REST/latest/#auth/1/session
126+
// Jira API docs: https://docs.atlassian.com/jira/REST/latest/#auth/1/session
127127
//
128128
// Deprecated: Use CookieAuthTransport to create base client. Logging out is as simple as not using the
129129
// client anymore
@@ -163,7 +163,7 @@ func (s *AuthenticationService) Logout() error {
163163

164164
// GetCurrentUserWithContext gets the details of the current user.
165165
//
166-
// JIRA API docs: https://docs.atlassian.com/jira/REST/latest/#auth/1/session
166+
// Jira API docs: https://docs.atlassian.com/jira/REST/latest/#auth/1/session
167167
func (s *AuthenticationService) GetCurrentUserWithContext(ctx context.Context) (*Session, error) {
168168
if s == nil {
169169
return nil, fmt.Errorf("authentication Service is not instantiated")

board.go

+10-10
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ import (
77
"time"
88
)
99

10-
// BoardService handles Agile Boards for the JIRA instance / API.
10+
// BoardService handles Agile Boards for the Jira instance / API.
1111
//
12-
// JIRA API docs: https://docs.atlassian.com/jira-software/REST/server/
12+
// Jira API docs: https://docs.atlassian.com/jira-software/REST/server/
1313
type BoardService struct {
1414
client *Client
1515
}
@@ -23,7 +23,7 @@ type BoardsList struct {
2323
Values []Board `json:"values" structs:"values"`
2424
}
2525

26-
// Board represents a JIRA agile board
26+
// Board represents a Jira agile board
2727
type Board struct {
2828
ID int `json:"id,omitempty" structs:"id,omitempty"`
2929
Self string `json:"self,omitempty" structs:"self,omitempty"`
@@ -63,7 +63,7 @@ type SprintsList struct {
6363
Values []Sprint `json:"values" structs:"values"`
6464
}
6565

66-
// Sprint represents a sprint on JIRA agile board
66+
// Sprint represents a sprint on Jira agile board
6767
type Sprint struct {
6868
ID int `json:"id" structs:"id"`
6969
Name string `json:"name" structs:"name"`
@@ -127,7 +127,7 @@ type BoardConfigurationColumnStatus struct {
127127

128128
// GetAllBoardsWithContext will returns all boards. This only includes boards that the user has permission to view.
129129
//
130-
// JIRA API docs: https://docs.atlassian.com/jira-software/REST/cloud/#agile/1.0/board-getAllBoards
130+
// Jira API docs: https://docs.atlassian.com/jira-software/REST/cloud/#agile/1.0/board-getAllBoards
131131
func (s *BoardService) GetAllBoardsWithContext(ctx context.Context, opt *BoardListOptions) (*BoardsList, *Response, error) {
132132
apiEndpoint := "rest/agile/1.0/board"
133133
url, err := addOptions(apiEndpoint, opt)
@@ -157,7 +157,7 @@ func (s *BoardService) GetAllBoards(opt *BoardListOptions) (*BoardsList, *Respon
157157
// GetBoardWithContext will returns the board for the given boardID.
158158
// This board will only be returned if the user has permission to view it.
159159
//
160-
// JIRA API docs: https://docs.atlassian.com/jira-software/REST/cloud/#agile/1.0/board-getBoard
160+
// Jira API docs: https://docs.atlassian.com/jira-software/REST/cloud/#agile/1.0/board-getBoard
161161
func (s *BoardService) GetBoardWithContext(ctx context.Context, boardID int) (*Board, *Response, error) {
162162
apiEndpoint := fmt.Sprintf("rest/agile/1.0/board/%v", boardID)
163163
req, err := s.client.NewRequestWithContext(ctx, "GET", apiEndpoint, nil)
@@ -187,7 +187,7 @@ func (s *BoardService) GetBoard(boardID int) (*Board, *Response, error) {
187187
// Note, if the user does not have the 'Create shared objects' permission and tries to create a shared board, a private
188188
// board will be created instead (remember that board sharing depends on the filter sharing).
189189
//
190-
// JIRA API docs: https://docs.atlassian.com/jira-software/REST/cloud/#agile/1.0/board-createBoard
190+
// Jira API docs: https://docs.atlassian.com/jira-software/REST/cloud/#agile/1.0/board-createBoard
191191
func (s *BoardService) CreateBoardWithContext(ctx context.Context, board *Board) (*Board, *Response, error) {
192192
apiEndpoint := "rest/agile/1.0/board"
193193
req, err := s.client.NewRequestWithContext(ctx, "POST", apiEndpoint, board)
@@ -212,7 +212,7 @@ func (s *BoardService) CreateBoard(board *Board) (*Board, *Response, error) {
212212

213213
// DeleteBoardWithContext will delete an agile board.
214214
//
215-
// JIRA API docs: https://docs.atlassian.com/jira-software/REST/cloud/#agile/1.0/board-deleteBoard
215+
// Jira API docs: https://docs.atlassian.com/jira-software/REST/cloud/#agile/1.0/board-deleteBoard
216216
func (s *BoardService) DeleteBoardWithContext(ctx context.Context, boardID int) (*Board, *Response, error) {
217217
apiEndpoint := fmt.Sprintf("rest/agile/1.0/board/%v", boardID)
218218
req, err := s.client.NewRequestWithContext(ctx, "DELETE", apiEndpoint, nil)
@@ -235,7 +235,7 @@ func (s *BoardService) DeleteBoard(boardID int) (*Board, *Response, error) {
235235
// GetAllSprintsWithContext will return all sprints from a board, for a given board Id.
236236
// This only includes sprints that the user has permission to view.
237237
//
238-
// JIRA API docs: https://docs.atlassian.com/jira-software/REST/cloud/#agile/1.0/board/{boardId}/sprint
238+
// Jira API docs: https://docs.atlassian.com/jira-software/REST/cloud/#agile/1.0/board/{boardId}/sprint
239239
func (s *BoardService) GetAllSprintsWithContext(ctx context.Context, boardID string) ([]Sprint, *Response, error) {
240240
id, err := strconv.Atoi(boardID)
241241
if err != nil {
@@ -258,7 +258,7 @@ func (s *BoardService) GetAllSprints(boardID string) ([]Sprint, *Response, error
258258
// GetAllSprintsWithOptionsWithContext will return sprints from a board, for a given board Id and filtering options
259259
// This only includes sprints that the user has permission to view.
260260
//
261-
// JIRA API docs: https://docs.atlassian.com/jira-software/REST/cloud/#agile/1.0/board/{boardId}/sprint
261+
// Jira API docs: https://docs.atlassian.com/jira-software/REST/cloud/#agile/1.0/board/{boardId}/sprint
262262
func (s *BoardService) GetAllSprintsWithOptionsWithContext(ctx context.Context, boardID int, options *GetAllSprintsOptions) (*SprintsList, *Response, error) {
263263
apiEndpoint := fmt.Sprintf("rest/agile/1.0/board/%d/sprint", boardID)
264264
url, err := addOptions(apiEndpoint, options)

component.go

+4-5
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,13 @@ package jira
22

33
import "context"
44

5-
// ComponentService handles components for the JIRA instance / API.
6-
//
7-
// JIRA API docs: https://docs.atlassian.com/software/jira/docs/api/REST/7.10.1/#api/2/component
5+
// ComponentService handles components for the Jira instance / API.//
6+
// Jira API docs: https://docs.atlassian.com/software/jira/docs/api/REST/7.10.1/#api/2/component
87
type ComponentService struct {
98
client *Client
109
}
1110

12-
// CreateComponentOptions are passed to the ComponentService.Create function to create a new JIRA component
11+
// CreateComponentOptions are passed to the ComponentService.Create function to create a new Jira component
1312
type CreateComponentOptions struct {
1413
Name string `json:"name,omitempty" structs:"name,omitempty"`
1514
Description string `json:"description,omitempty" structs:"description,omitempty"`
@@ -21,7 +20,7 @@ type CreateComponentOptions struct {
2120
ProjectID int `json:"projectId,omitempty" structs:"projectId,omitempty"`
2221
}
2322

24-
// CreateWithContext creates a new JIRA component based on the given options.
23+
// CreateWithContext creates a new Jira component based on the given options.
2524
func (s *ComponentService) CreateWithContext(ctx context.Context, options *CreateComponentOptions) (*ProjectComponent, *Response, error) {
2625
apiEndpoint := "rest/api/2/component"
2726
req, err := s.client.NewRequestWithContext(ctx, "POST", apiEndpoint, options)

component_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ func TestComponentService_Create_Success(t *testing.T) {
1414
testRequestURL(t, r, "/rest/api/2/component")
1515

1616
w.WriteHeader(http.StatusCreated)
17-
fmt.Fprint(w, `{ "self": "http://www.example.com/jira/rest/api/2/component/10000", "id": "10000", "name": "Component 1", "description": "This is a JIRA component", "lead": { "self": "http://www.example.com/jira/rest/api/2/user?username=fred", "name": "fred", "avatarUrls": { "48x48": "http://www.example.com/jira/secure/useravatar?size=large&ownerId=fred", "24x24": "http://www.example.com/jira/secure/useravatar?size=small&ownerId=fred", "16x16": "http://www.example.com/jira/secure/useravatar?size=xsmall&ownerId=fred", "32x32": "http://www.example.com/jira/secure/useravatar?size=medium&ownerId=fred" }, "displayName": "Fred F. User", "active": false }, "assigneeType": "PROJECT_LEAD", "assignee": { "self": "http://www.example.com/jira/rest/api/2/user?username=fred", "name": "fred", "avatarUrls": { "48x48": "http://www.example.com/jira/secure/useravatar?size=large&ownerId=fred", "24x24": "http://www.example.com/jira/secure/useravatar?size=small&ownerId=fred", "16x16": "http://www.example.com/jira/secure/useravatar?size=xsmall&ownerId=fred", "32x32": "http://www.example.com/jira/secure/useravatar?size=medium&ownerId=fred" }, "displayName": "Fred F. User", "active": false }, "realAssigneeType": "PROJECT_LEAD", "realAssignee": { "self": "http://www.example.com/jira/rest/api/2/user?username=fred", "name": "fred", "avatarUrls": { "48x48": "http://www.example.com/jira/secure/useravatar?size=large&ownerId=fred", "24x24": "http://www.example.com/jira/secure/useravatar?size=small&ownerId=fred", "16x16": "http://www.example.com/jira/secure/useravatar?size=xsmall&ownerId=fred", "32x32": "http://www.example.com/jira/secure/useravatar?size=medium&ownerId=fred" }, "displayName": "Fred F. User", "active": false }, "isAssigneeTypeValid": false, "project": "HSP", "projectId": 10000 }`)
17+
fmt.Fprint(w, `{ "self": "http://www.example.com/jira/rest/api/2/component/10000", "id": "10000", "name": "Component 1", "description": "This is a Jira component", "lead": { "self": "http://www.example.com/jira/rest/api/2/user?username=fred", "name": "fred", "avatarUrls": { "48x48": "http://www.example.com/jira/secure/useravatar?size=large&ownerId=fred", "24x24": "http://www.example.com/jira/secure/useravatar?size=small&ownerId=fred", "16x16": "http://www.example.com/jira/secure/useravatar?size=xsmall&ownerId=fred", "32x32": "http://www.example.com/jira/secure/useravatar?size=medium&ownerId=fred" }, "displayName": "Fred F. User", "active": false }, "assigneeType": "PROJECT_LEAD", "assignee": { "self": "http://www.example.com/jira/rest/api/2/user?username=fred", "name": "fred", "avatarUrls": { "48x48": "http://www.example.com/jira/secure/useravatar?size=large&ownerId=fred", "24x24": "http://www.example.com/jira/secure/useravatar?size=small&ownerId=fred", "16x16": "http://www.example.com/jira/secure/useravatar?size=xsmall&ownerId=fred", "32x32": "http://www.example.com/jira/secure/useravatar?size=medium&ownerId=fred" }, "displayName": "Fred F. User", "active": false }, "realAssigneeType": "PROJECT_LEAD", "realAssignee": { "self": "http://www.example.com/jira/rest/api/2/user?username=fred", "name": "fred", "avatarUrls": { "48x48": "http://www.example.com/jira/secure/useravatar?size=large&ownerId=fred", "24x24": "http://www.example.com/jira/secure/useravatar?size=small&ownerId=fred", "16x16": "http://www.example.com/jira/secure/useravatar?size=xsmall&ownerId=fred", "32x32": "http://www.example.com/jira/secure/useravatar?size=medium&ownerId=fred" }, "displayName": "Fred F. User", "active": false }, "isAssigneeTypeValid": false, "project": "HSP", "projectId": 10000 }`)
1818
})
1919

2020
component, _, err := testClient.Component.Create(&CreateComponentOptions{

error.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import (
1010
"github.com/pkg/errors"
1111
)
1212

13-
// Error message from JIRA
13+
// Error message from Jira
1414
// See https://docs.atlassian.com/jira/REST/cloud/#error-responses
1515
type Error struct {
1616
HTTPError error

0 commit comments

Comments
 (0)