@@ -16,20 +16,20 @@ import (
16
16
17
17
type IssueQueryProvider interface {
18
18
ProvideIssueQueryString () string
19
- ProvideDefaultProject () string
19
+ ProvideDefaultProject () string
20
20
}
21
21
22
22
type IssueOptions struct {
23
- Fields []string `json:"fields,omitempty" yaml:"fields,omitempty"`
24
- Expand []string `json:"expand,omitempty" yaml:"expand,omitempty"`
25
- Properties []string `json:"properties,omitempty" yaml:"properties,omitempty"`
26
- FieldsByKeys bool `json:"fieldsByKeys,omitempty" yaml:"fieldsByKeys,omitempty"`
27
- UpdateHistory bool `json:"updateHistory,omitempty" yaml:"updateHistory,omitempty"`
28
- Project string `json:"project,omitempty" yaml:"project,omitempty"`
23
+ Fields []string `json:"fields,omitempty" yaml:"fields,omitempty"`
24
+ Expand []string `json:"expand,omitempty" yaml:"expand,omitempty"`
25
+ Properties []string `json:"properties,omitempty" yaml:"properties,omitempty"`
26
+ FieldsByKeys bool `json:"fieldsByKeys,omitempty" yaml:"fieldsByKeys,omitempty"`
27
+ UpdateHistory bool `json:"updateHistory,omitempty" yaml:"updateHistory,omitempty"`
28
+ Project string `json:"project,omitempty" yaml:"project,omitempty"`
29
29
}
30
30
31
31
func (o * IssueOptions ) ProvideDefaultProject () string {
32
- return o .Project
32
+ return o .Project
33
33
}
34
34
35
35
func (o * IssueOptions ) ProvideIssueQueryString () string {
@@ -56,8 +56,8 @@ func (o *IssueOptions) ProvideIssueQueryString() string {
56
56
}
57
57
58
58
func CaseInsensitiveContains (s , substr string ) bool {
59
- s , substr = strings .ToUpper (s ), strings .ToUpper (substr )
60
- return strings .Contains (s , substr )
59
+ s , substr = strings .ToUpper (s ), strings .ToUpper (substr )
60
+ return strings .Contains (s , substr )
61
61
}
62
62
63
63
// https://docs.atlassian.com/jira/REST/cloud/#api/2/issue-getIssue
@@ -67,7 +67,7 @@ func (j *Jira) GetIssue(issue string, iqg IssueQueryProvider) (*jiradata.Issue,
67
67
68
68
func GetIssue (ua HttpClient , endpoint string , issue string , iqg IssueQueryProvider ) (* jiradata.Issue , error ) {
69
69
query := ""
70
- pro := iqg .ProvideDefaultProject ()
70
+ pro := iqg .ProvideDefaultProject ()
71
71
if iqg != nil {
72
72
query = iqg .ProvideIssueQueryString ()
73
73
}
@@ -83,11 +83,11 @@ func GetIssue(ua HttpClient, endpoint string, issue string, iqg IssueQueryProvid
83
83
results := & jiradata.Issue {}
84
84
return results , json .NewDecoder (resp .Body ).Decode (results )
85
85
}
86
- // Ticket not found, maybe try prepend Project value?
87
- if ! CaseInsensitiveContains (issue ,pro ) {
88
- issue = pro + "-" + issue
89
- return GetIssue (ua , endpoint , issue , iqg )
90
- }
86
+ // Ticket not found, maybe try prepend Project value?
87
+ if ! CaseInsensitiveContains (issue ,pro ) {
88
+ issue = pro + "-" + issue
89
+ return GetIssue (ua , endpoint , issue , iqg )
90
+ }
91
91
return nil , responseError (resp )
92
92
}
93
93
0 commit comments