Open marcgemis opened 1 month ago
Thank you for opening this issue!
🔔 @niallpaterson @0w0miki you might want to have a look.
Hi @marcgemis would you like to test https://github.com/raycast/extensions/pull/11918 ?
HI @haydencbarnes, I tried it, but is seems that our server is responding with HTML instead of JSON when the list of projects is retrieved. I briefly see a message complaining that '<' is not a recognized token in the Raycast window
In the terminal window I only see ` ready - built extension successfully
06:47:28.296 Fetching projects from: /rest/api/2/project?maxResults=500&startAt=0 06:48:47.693 Fetching projects from: /rest/api/2/project?maxResults=500&startAt=0 06:49:30.970 Fetching projects from: /rest/api/2/project?maxResults=500&startAt=0 06:50:37.461 Fetching projects from: /rest/api/2/project?maxResults=500&startAt=0 06:51:15.934 Fetching projects from: /rest/api/2/project?maxResults=500&startAt=0 06:51:38.589 Fetching projects from: /rest/api/2/project?maxResults=500&startAt=0 06:54:35.124 Fetching projects from: /rest/api/2/project?maxResults=500&startAt=0 07:04:35.378 Fetching projects from: /rest/api/2/project?maxResults=500&startAt=0 07:06:56.909 Fetching projects from: /rest/api/2/project?maxResults=500&startAt=0 07:07:01.819 Fetching projects from: /rest/api/2/project?maxResults=500&startAt=0 `
I added some log instructions, e.g. in requests.ts, just above the const responseBody = await res.json()
The "res" is
` 07:20:36.988 The response: Response {
size: 0,
body: PassThrough {
_readableState: [ReadableState],
_events: [Object: null prototype],
_eventsCount: 6,
_maxListeners: undefined,
_writableState: [WritableState],
allowHalfOpen: true,
[Symbol(kCapture)]: false,
[Symbol(kCallback)]: null
},
stream: PassThrough {
_readableState: [ReadableState],
_events: [Object: null prototype],
_eventsCount: 6,
_maxListeners: undefined,
_writableState: [WritableState],
allowHalfOpen: true,
[Symbol(kCapture)]: false,
[Symbol(kCallback)]: null
},
boundary: null,
disturbed: false,
error: null
},
type: 'default',
url: 'https://********/rest/api/2/project?maxResults=500&startAt=0',
status: 403,
statusText: '',
headers: {
connection: 'close',
'content-security-policy': "frame-ancestors 'self'",
'content-type<…>
`
of course the ** is the name of our jira host. When I click on that URL in the browser I do get the projects in json format.
When I replace `
/* Authorization: Basic ${Buffer.from(
${prefs.username}:${prefs.token}).toString("base64")}
, /
Authorization: Bearer ${prefs.token}
,
`
in requests.ts, it works
The above authorization line is based on the code found in the jira-search-self-hosted extension.
@marcgemis, that's interesting. As this is not a file I changed, let me look through it here quickly and confirm that it also works for the cloud. It's interesting that it also gives you a 403, and for me, it does not.
Bearer does not work as nicely for the cloud, unfortunately. OAuth2 Bearers have been added to Jira Server but not to Jira Cloud yet for some reason. But according to https://developer.atlassian.com/server/jira/platform/basic-authentication/ this current request should work fine, and works for me on multiple instances. @marcgemis Can you please shoot me a message over on https://raycastcommunity.slack.com/team/U06UKMRBUU9 with a screenshot of your config for the extension.
The username/email field is what I am interested in, not your token, because we know that works. (Except for the question I have below this.)
Also, I would like to confirm that you are using your personal API key and not your organization's API key?
https://********/rest/api/2/project?maxResults=500&startAt=0'
The URL works because you are already authenticated in your browser, the 403 error you are receiving here is a credentials issue.
Also, I would like to confirm that you are using your personal API key and not your organization's API key?
Yes, I generated a key in Jira via Profile > Personal Access Tokens
We do have Jira v9.12.7#9120007
I don't understand it anymore. Now it works with both methods of authentication, and with email and user name in the settings. Maybe something is cached now?
Hmmm, you could try uninstalling and reinstalling the extension.
After stopping Raycast, removing the plugin folder, restarting Raycart and retrieving the plugin again, it stopped working. I tried again with email and user name. Nothing worked. As soon as I use the authentication with the Bearer token, it works.
@marcgemis Copy that. Since I have already written the code for switching between APIs for Server/Cloud, will submit a commit here in a minute that switches between bearer for Server and basic for Cloud.
@marcgemis Can you please pull the latest and retry? The update I just submitted to requests.ts should fix your issue.
seems to work for the project I tried yesterday. (ca 3000 issues) I seem to have problems with a project with + 23000 issues (+10 year old project) but that is unrelated to this.
seems to work for the project I tried yesterday. (ca 3000 issues)
I seem to have problems with a project with + 23000 issues (+10 year old project) but that is unrelated to this.
How many of the 23,000 does it load?
Nevermind, I see https://github.com/raycast/extensions/issues/12886
@pernielsentikaer This can be closed courtesy of https://github.com/raycast/extensions/pull/11918
Extension
https://www.raycast.com/niallpaterson/jira-time-tracking
Description
The plug-in does not work for an on-prem installation of Jira. I tried to compare the Jira and Jira On-Prem plug-ins. I think the Authorization headers are slightly different. Would it possible make the plug-in compatible with an on-prem Jira? Or release a separate version?
Who will benefit from this feature?
Everyone with an on-prem installation of Jira
Anything else?
No response