andygrunwald / andygrunwald/go-jira

Issue.Search()'s Status field isn't being set

Aperta
#331 3 commenti 0 reazioni 0 assegnatari Vedi su GitHub
needs triage
Lingua principale
Go
Stelle
1.6k
Fork
500
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

## Describe the bug

Hey all,

I recently began learning Go and working on a little project w/Jira to learn, so this may be an issue with my knowledge.

The issue is that when I use the Issue.Search() function, the Fields.Status field/property comes back as nil.

### Example:
```
u, _, err := client.Issue.Search("\"Epic Link\" = DOP-8", &searchOptions)
for _, issue := range u {
fmt.Printf("Key:%s | Status:%+v | Summary: %+v\n", issue.Key, issue.Fields.Status, issue.Fields.Summary)
}
```

```
OUTPUT:
Key:DOP-16 | Status: | Summary: s8
Key:DOP-15 | Status: | Summary: s7
etc...
```

However if I get a single issue via the Issue.Get() function, Fields.Status is set and contains the status and status category of the issue.

```
for _, issue := range u {
oneIssue, _, err := client.Issue.Get(issue.Key, nil)
fmt.Printf("Status: %+v\n", oneIssue.Fields.Status)
}

```

```
OUTPUT:
Status: &{Self:https:/....atlassian.net/rest/api/2/status/10001 Description: IconURL:https://....atlassian.net/ Name:Done ID:10001 StatusCategory:{Self:https://....atlassian.net/rest/api/2/statuscategory/3 ID:3 Name:Done Key:done ColorName:green}}
Status: &{Self:https://....atlassian.net/rest/api/2/status/10001 Description: IconURL:https://....atlassian.net/ Name:Done ID:10001 StatusCategory:{Self:https://....atlassian.net/rest/api/2/statuscategory/3 ID:3 Name:Done Key:done ColorName:green}}
```

If I get proficient enough would be happy to contribute a fix, but not sure if the issue from Search is expected behavior, and if I'm missing something...

Thx.

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.