Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Jira Time Tracking] Please add support for On-Prem Jira installation #12550

Closed
marcgemis opened this issue May 24, 2024 · 21 comments
Closed

[Jira Time Tracking] Please add support for On-Prem Jira installation #12550

marcgemis opened this issue May 24, 2024 · 21 comments
Labels
extension: jira-time-tracking Issues related to the jira-time-tracking extension extension Issues related to one of the extensions in the Store feature request New feature or improvement

Comments

@marcgemis
Copy link

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

@marcgemis marcgemis added extension Issues related to one of the extensions in the Store feature request New feature or improvement labels May 24, 2024
@raycastbot raycastbot added the extension: jira-time-tracking Issues related to the jira-time-tracking extension label May 24, 2024
@raycastbot
Copy link
Collaborator

Thank you for opening this issue!

🔔 @niallpaterson @0w0miki you might want to have a look.

💡 Author and Contributors commands

The author and contributors of niallpaterson/jira-time-tracking can trigger bot actions by commenting:

  • @raycastbot close this issue Closes the issue.
  • @raycastbot rename this issue to "Awesome new title" Renames the issue.
  • @raycastbot reopen this issue Reopens the issue.
  • @raycastbot assign me Assigns yourself to the issue.
  • @raycastbot good first issue Adds the "Good first issue" label to the issue.

@haydencbarnes
Copy link
Contributor

haydencbarnes commented Jun 5, 2024

Hi @marcgemis would you like to test #11918 ?

@marcgemis
Copy link
Author

marcgemis commented Jun 10, 2024

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
`

@marcgemis
Copy link
Author

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,
[Symbol(Body internals)]: {
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
},
[Symbol(Response internals)]: {
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.

@marcgemis
Copy link
Author

marcgemis commented Jun 10, 2024

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.

@haydencbarnes
Copy link
Contributor

@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.

@haydencbarnes
Copy link
Contributor

haydencbarnes commented Jun 10, 2024

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.

@haydencbarnes
Copy link
Contributor

haydencbarnes commented Jun 10, 2024

CleanShot 2024-06-10 at 01 45 27@2x
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.)

@haydencbarnes
Copy link
Contributor

haydencbarnes commented Jun 10, 2024

Also, I would like to confirm that you are using your personal API key and not your organization's API key?

@haydencbarnes
Copy link
Contributor

haydencbarnes commented Jun 10, 2024

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.

@marcgemis
Copy link
Author

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?

@haydencbarnes
Copy link
Contributor

haydencbarnes commented Jun 10, 2024

Hmmm, you could try uninstalling and reinstalling the extension.

@marcgemis
Copy link
Author

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.

@haydencbarnes
Copy link
Contributor

haydencbarnes commented Jun 10, 2024

@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.

@haydencbarnes
Copy link
Contributor

@marcgemis Can you please pull the latest and retry? The update I just submitted to requests.ts should fix your issue.

@marcgemis
Copy link
Author

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.

@haydencbarnes
Copy link
Contributor

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?

@haydencbarnes
Copy link
Contributor

Nevermind, I see #12886

@haydencbarnes
Copy link
Contributor

@pernielsentikaer This can be closed courtesy of #11918

@raycastbot
Copy link
Collaborator

This issue has been automatically marked as stale because it did not have any recent activity.

It will be closed if no further activity occurs in the next 10 days to keep our backlog clean 😊

@raycastbot raycastbot added the status: stalled Stalled due inactivity label Aug 6, 2024
@haydencbarnes
Copy link
Contributor

@raycastbot close this issue

@raycastbot raycastbot removed the status: stalled Stalled due inactivity label Aug 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
extension: jira-time-tracking Issues related to the jira-time-tracking extension extension Issues related to one of the extensions in the Store feature request New feature or improvement
Projects
None yet
Development

No branches or pull requests

3 participants