mirror of
https://github.com/interviewstreet/go-jira.git
synced 2025-02-09 13:36:58 +02:00
if not authenticated, fallback to use api/2 for issue get
This commit is contained in:
parent
de750e2c4a
commit
98ec0fc47f
3
issue.go
3
issue.go
@ -528,6 +528,9 @@ type CustomFields map[string]string
|
||||
// JIRA API docs: https://docs.atlassian.com/jira/REST/latest/#api/2/issue-getIssue
|
||||
func (s *IssueService) Get(issueID string, options *GetQueryOptions) (*Issue, *Response, error) {
|
||||
apiEndpoint := fmt.Sprintf("rest/agile/1.0/issue/%s", issueID)
|
||||
if !s.client.Authentication.Authenticated() {
|
||||
apiEndpoint = fmt.Sprintf("rest/api/2/issue/%s", issueID)
|
||||
}
|
||||
req, err := s.client.NewRequest("GET", apiEndpoint, nil)
|
||||
if err != nil {
|
||||
return nil, nil, err
|
||||
|
Loading…
x
Reference in New Issue
Block a user