fix: Replace user parameter with JIRA_USER environment variable in SetBasicAuth calls
Co-authored-by: aider (openai/qwen3-coder:30b-a3b-q4_K_M) <aider@aider.chat>
This commit is contained in:
parent
362fbe60dc
commit
158a14706b
1 changed files with 2 additions and 6 deletions
|
|
@ -45,11 +45,10 @@ type UserSearchResp struct {
|
|||
|
||||
func getUserAccountID(instance, user string) (string, error) {
|
||||
req, err := http.NewRequest(http.MethodGet, fmt.Sprintf("https://%s/rest/api/3/user/search?query=%s", instance, user), nil)
|
||||
fmt.Println(user)
|
||||
if err != nil {
|
||||
return "", fmt.Errorf("error building jira user search request: %w", err)
|
||||
}
|
||||
req.SetBasicAuth(user, os.Getenv("JIRA_TOKEN"))
|
||||
req.SetBasicAuth(os.Getenv("JIRA_USER"), os.Getenv("JIRA_TOKEN"))
|
||||
req.Header.Add("Accept", "application/json")
|
||||
resp, err := jcl.Do(req)
|
||||
if err != nil {
|
||||
|
|
@ -90,7 +89,7 @@ func GetIssues(instance, user, from, to string) ([]Issue, error) {
|
|||
q.Add("jql", fmt.Sprintf("assignee was %s and resolved >= %s and resolved <= %s", accountID, from, to))
|
||||
q.Add("fields", "*all")
|
||||
req.URL.RawQuery = q.Encode()
|
||||
req.SetBasicAuth(user, os.Getenv("JIRA_TOKEN"))
|
||||
req.SetBasicAuth(os.Getenv("JIRA_USER"), os.Getenv("JIRA_TOKEN"))
|
||||
req.Header.Add("Accept", "application/json")
|
||||
resp, err := jcl.Do(req)
|
||||
if err != nil {
|
||||
|
|
@ -112,14 +111,11 @@ func GetIssues(instance, user, from, to string) ([]Issue, error) {
|
|||
out := []Issue{}
|
||||
|
||||
for _, i := range jsr.Issues {
|
||||
fmt.Println(i)
|
||||
iss := Issue{}
|
||||
if s, ok := i.Fields["summary"]; ok {
|
||||
fmt.Println(s)
|
||||
iss.Summary, _ = s.(string)
|
||||
}
|
||||
if d, ok := i.Fields["description"]; ok {
|
||||
fmt.Println(d)
|
||||
iss.Description, _ = d.(string)
|
||||
}
|
||||
if comms, ok := i.Fields["comment"].([]map[string]any); ok && len(comms) > 0 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue