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

Searching for a ticket number does not yield the ticket #50

Open
jneidel opened this issue Aug 20, 2023 · 7 comments
Open

Searching for a ticket number does not yield the ticket #50

jneidel opened this issue Aug 20, 2023 · 7 comments

Comments

@jneidel
Copy link
Contributor

jneidel commented Aug 20, 2023

Desktop (please complete the following information):

  • OS: MacOS Ventura
  • Terminal: Kitty
  • Architecture: x86
  • Fjira version: 0.11.0

Describe the bug
Searching for only the numbers of a ticket id, does not show me the ticket.

E.g.:
Screenshot 2023-08-20 at 20 01 26

To Reproduce

  1. Open a project in the app.
  2. Start typing in the numbers of a ticket id
  3. See nothing 😄

Expected behavior

Same as putting in the whole ticket id:

Screenshot 2023-08-20 at 20 00 39
@mk-5
Copy link
Owner

mk-5 commented Aug 21, 2023

@jneidel I will have a look, thanks for such a great testing ❤️

I know what's the reason here. I've introduced some debounce in order to not trigger jira search query with every key event. When you press "backspace" the results should be refreshed, - there is no debounce for "backspace".

@mk-5
Copy link
Owner

mk-5 commented Aug 21, 2023

okay / I found a reason. The fix is almost ready.

@mk-5
Copy link
Owner

mk-5 commented Aug 22, 2023

the problem is a bit more tricky. So there is a mechanism already that fjira is asking Jira API about new search results if query looks like jira ticket number. JQL goes like this: issuekey=?. Unfortunately there is nothing like issuekey contains in Jira Api.

It will require big change in fjira fuzzy finding mechansm, -but it's possible. In current implementation it's a mix-up of jira search api, and fuzzy finding. Jira issues are re-fetched from Jira Api in some concrete cases. The only way I see to make : issuekey contains part of the key' would be to pre-fetch all of the Jira issues for the project, cache them - and then monitor, and keep cache in sync.

It's possible change, and I need to say that I like it - but it also has some cons. The main question her would be .. is it really have some benefit to search via "part of the issue key"?

@jneidel
Copy link
Contributor Author

jneidel commented Aug 23, 2023

does it really have some benefit to search via "part of the issue key"?

When using whole issue keys I never type them out, I only use them via copy-paste.

In my project we reference issues via the number. So if a colleague in a meeting references issue 9912, then I don't want to spell out the always-the-same prefix. Especially when it's about quick access. (Which is where this app shines.)

My current workflow for that has been:

  • go to browser
  • go to any jira page
  • change the ticket number

@mk-5
Copy link
Owner

mk-5 commented Aug 23, 2023

@jneidel I have the similar workflow. I'm using fjira like this:

fjira ABC-9912

it's opening the issue view right away.

I'm investigating the solution mentioned by me in the previous comment. I like it, but it could be challenging.
The solution might goes like this: fjira can scrap the whole project in the background - similar to what fzf is doing when you run it from the top of your filesystem - the results are dynamically added to the list. Then fuzzy finding could be done on the whole collection, and searching via part of the key will be possible.
The potential problem is Jira Api speed. I did some tests, and it takes ~600-1000ms to fetch 100 records. I checked Jira Cloud Api. It could take 10-20 seconds to fetch 2000 records. Pretty slow..

image

@mk-5
Copy link
Owner

mk-5 commented Aug 24, 2023

I found a suggestion here https://community.atlassian.com/t5/Jira-questions/How-to-filter-using-JIRA-ticket-numbers/qaq-p/1422090 they said that jql like this:

project = ABC and key >= 'ABC-01' should be possible. I will give it a try

@jneidel
Copy link
Contributor Author

jneidel commented Aug 28, 2023

Hi mk-5,

fjira ABC-9912

This fits fine for my workflow 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants