fjira icon indicating copy to clipboard operation
fjira copied to clipboard

Searching for a ticket number does not yield the ticket

Open jneidel opened this issue 2 years ago • 7 comments

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 :smile:

Expected behavior

Same as putting in the whole ticket id:

Screenshot 2023-08-20 at 20 00 39

jneidel avatar Aug 20 '23 18:08 jneidel

@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 avatar Aug 21 '23 08:08 mk-5

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

mk-5 avatar Aug 21 '23 22:08 mk-5

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"?

mk-5 avatar Aug 22 '23 19:08 mk-5

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

jneidel avatar Aug 23 '23 11:08 jneidel

@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 avatar Aug 23 '23 20:08 mk-5

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

mk-5 avatar Aug 24 '23 06:08 mk-5

Hi mk-5,

fjira ABC-9912

This fits fine for my workflow :+1:

jneidel avatar Aug 28 '23 13:08 jneidel