andygrunwald / andygrunwald/go-jira

Filter.GetList() uses wrong path for listing filters

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

Descrizione

## What happened?

Making a request using `Filter.GetList()` to list all filters fails with `404` and the response:

```bash
Your Get filters operation didn't return any results. Use the Search filters operation instead (See: https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-filters/#api-rest-api-2-filter-search-get).: request failed. Please analyze the request body for more details. Status code: 404"
```

## What did you expect to happen?

The call to `Filter.GetList()` returns a list of filters: `[]*Filter`

## How can we reproduce it (as minimally and precisely as possible)?

Minimal code to reproduce:

```go
tp := jira.BasicAuthTransport{
Username: "username",
Password: "token",
}

client, err := jira.NewClient(tp.Client(), "https://my.jira.com")
_, _, err := client.Filter.GetList()
if err != nil {
log.Fatalf("%s", err.Error())
}
```

## Anything else we need to know?

I checked the code and compared with the Jira API manual and it looks like the path used for making a request is wrong.

The path currently used for v2:
https://github.com/andygrunwald/go-jira/blob/cfa118a2a9d453de52fb169c3c6cf24102afacec/cloud/filter.go#L129

But if you check the [Jira API manual for v2](https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-filters/#api-group-filters), it doesn't list the path `/rest/api/2/filter`. My suspicions is that it needs to be replaced to `/rest/api/2/filter/search` ([source](https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-filters/#api-rest-api-2-filter-search-get))

## Your Environment

* go-jira version (git tag or sha): v1.16.0
* Go version (`go version`): 1.24.3
* Jira type (cloud or on-premise): cloud
* Jira version / Api version: not sure what is meant by it

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.