I am using OAuth 2 to connect to the Jira API. I have followed the documentation. The authentication and API calls go through, but when running a search query, I see no results.
reqBody, _ := json.Marshal(map[string]interface{}{
"expand": []string{"names"},
"jql": `text ~ ` + request.Query + ` order by created DESC`,
})
u := jiraAPIBaseURL + "/ex/jira/" + resource.ID + "/rest/api/3/search"
req, err := http.NewRequest(http.MethodPost, u, bytes.NewReader(reqBody))
The `resource.ID` is obtained through the call to `/oauth/token/accessible-resources`, as instructed in the documentation.
I have a project set up with two cards, but the result set is empty:
~
❯ curl localhost:8080/search/jira -d '{"query": "Lasagna"}'
{"results":{"issues":[],"maxResults":50,"startAt":0,"total":0}}
Raw request:
{"expand":["names"],"jql":"text ~ Lasagna order by created DESC"}
But the same JQL returns results in advanced search in my account:
Figured it out: the call was missing the Access Token.
Still thinking about joining us for Team '25 Europe? Early bird has been extended for just one week! Now’s the time to lock in your lowest rate. Use code TEU25COMM-20 to save 20% at checkout. Hurry, this only lasts for 1 more week.
Learn more
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.