Skip to content

Support Jira Cloud instance - #448

Merged
psss merged 7 commits into
mainfrom
jira-cloud
Mar 24, 2026
Merged

Support Jira Cloud instance#448
psss merged 7 commits into
mainfrom
jira-cloud

Conversation

@lukaszachy

Copy link
Copy Markdown
Collaborator

Assisted-by: Claude Code

Comment thread did/plugins/jira.py Fixed
@lukaszachy
lukaszachy marked this pull request as ready for review March 12, 2026 15:15
@brakogh

brakogh commented Mar 16, 2026

Copy link
Copy Markdown

We've migrated to Jira Cloud so having this resolved would be awesome!

@psss psss left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks much for preparing this! For now just some quick feedback. Will review more later today. Overal it seems to be working ok, I just ran into the following problem:

  • did last week --jira-created works fine
  • did last week --jira-resolved also correctly lists resolved issues
  • did last week --jira lists only created issues

Any idea what might be wrong?

Comment thread did/plugins/jira.py
Comment thread did/plugins/jira.py
lukaszachy and others added 4 commits March 16, 2026 11:51
Assisted-by: Claude Code
…substring sanitization

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Assisted-by: Claude Code
@psss psss added this to the 0.23 milestone Mar 16, 2026
@lukaszachy

lukaszachy commented Mar 16, 2026

Copy link
Copy Markdown
Collaborator Author

I found out that for JiraTransition we need to query not by user email but by AAID so I added the lookup.
Problem is that the lookup works when JiraTransition is the only stat I asked for. If run in parallel with others I get 200 status code but the 'users' field is empty.

Could it be some strange rate limiting? I don't see any headers saying any 'slow down please' though.

@lukaszachy

Copy link
Copy Markdown
Collaborator Author

I just ran into the following problem:

* `did last week --jira-created` works fine
* `did last week --jira-resolved` also correctly lists resolved issues
* `did last week --jira` lists only created issues

Any idea what might be wrong?

We had chat on slack but for future reference: It seems to be the same symptom as with the AAID lookup call - If jira queries are too fast jira returns

 DEBUG  Response status: 200
 DEBUG  Batch 0 result: 0 issues fetched
 DATA  {'isLast': True, 'issues': []}

Slowing down the rate (eg sleep) seems to mitigate the problem :/

@lukaszachy
lukaszachy requested a review from psss March 17, 2026 11:01
@lukaszachy

Copy link
Copy Markdown
Collaborator Author

And the culprit was race condition when self.session was initialized. There was a long time while session was already initialized but session.auth wasn't set properly. I've added lock to initialize it properly.

While checking I found out that 'after' didn't returned issues transitioned on that day. Added '00:00' to include it.

@BeeGrech

Copy link
Copy Markdown
Contributor

Maybe worth considering updating api calls to POST referring the Jira documentation:

https://developer.atlassian.com/changelog/#CHANGE-2046

@sandrobonazzola

Copy link
Copy Markdown
Collaborator

does this work for you? I still didn't manage to get this working for me

@BeeGrech

Copy link
Copy Markdown
Contributor

@sandrobonazzola I merged this with my PR and its working for me. I had no luck with GET's

Comment thread did/plugins/jira.py
@psss

psss commented Mar 20, 2026

Copy link
Copy Markdown
Owner

does this work for you? I still didn't manage to get this working for me

@sandrobonazzola, do you mean the POST method does not work for you? Or the current state of this PR? With the following config it works nice for me:

[jira]
type = jira
auth_type = basic
auth_username = psplicha@redhat.com
token = ***
url = https://redhat.atlassian.net/
api_version = 3

@sandrobonazzola

Copy link
Copy Markdown
Collaborator

@psss ok, it somehow work for me using your template. I missed the auth_type = basic using the token.
I see issueFunction is not working on Red Hat Cloud instance yet but it's a temporary limitation on that instance.
I feel annoying that the pagination is not working but I guess we can merge this PR and then refine it later on.

@michich

michich commented Mar 24, 2026

Copy link
Copy Markdown
Contributor

Please let's merge this and then add my additional fixes from #453

@sandrobonazzola
sandrobonazzola requested a review from psss March 24, 2026 07:23
Comment thread did/plugins/jira.py Outdated
Comment thread did/plugins/jira.py
@psss

psss commented Mar 24, 2026

Copy link
Copy Markdown
Owner

Yeah, let's get that improved step, by step. Added just a few nitpicks in 456de14.

@psss
psss merged commit fa8f42b into main Mar 24, 2026
15 checks passed
@psss
psss deleted the jira-cloud branch March 24, 2026 10:58
@psss psss self-assigned this Mar 27, 2026
@daobrien

Copy link
Copy Markdown

@sandrobonazzola @psss

Apologies if this is not the best place to ask. I didn't see a Discussions section.

We're using Jira cloud now and I can't get the new config to work. The two main issues appear to be:

[jira]
type = jira
url = https://redhat.atlassian.net/
auth_type = basic
auth_username = daobrien@redhat.com
auth_password = ***
api_version = 3

The section used to be called [jira-issues] and that worked. I don't really think that's the problem at all.
The auth_password is the API token that I created in the Jira cloud instance.

I have another section in the config file for Trello, and that works fine. It seems to be just changing to Jira cloud that's causing the problems. Did I miss something or get something wrong? Thanks for any help.

@psss

psss commented Mar 31, 2026

Copy link
Copy Markdown
Owner

@daobrien, could you please try my example config above? You should use token instead of auth_password. This should be also documented. We just need to tidy up the sections a bit to make it more clear to the users.

@daobrien

daobrien commented Mar 31, 2026

Copy link
Copy Markdown

@daobrien, could you please try my example config above? You should use token instead of auth_password. This should be also documented. We just need to tidy up the sections a bit to make it more clear to the users.

@psss afaict my config is the same as yours apart from using token, which I've just updated. Unfortunately now I get a different error:
ERROR Skipping section jira due to error: `auth_password` or `auth_password_file` must be set in the [jira] section.

Currently looking into the docs...

@psss

psss commented Mar 31, 2026

Copy link
Copy Markdown
Owner

Do you have the latest did installed? The fresh fedora update on the way but you can also use the did copr repo.

@daobrien

daobrien commented Mar 31, 2026

Copy link
Copy Markdown

Do you have the latest did installed? The fresh fedora update on the way but you can also use the did copr repo.

Yes just installed it a couple of hours ago on F42. (Feel free to use Slack if that's easier/faster.)
Source RPM : did-0.22-1.fc42.src.rpm

So, not the absolute latest. I'll add the COPR repo and try that.

@daobrien

Copy link
Copy Markdown

Do you have the latest did installed? The fresh fedora update on the way but you can also use the did copr repo.

Yes just installed it a couple of hours ago on F42. (Feel free to use Slack if that's easier/faster.) Source RPM : did-0.22-1.fc42.src.rpm

So, not the absolute latest. I'll add the COPR repo and try that.

Ok, that did it. Thanks 👍

@psss

psss commented Apr 1, 2026

Copy link
Copy Markdown
Owner

Ok, that did it. Thanks 👍

Good! 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants