joplin-plugin-jira-issue
joplin-plugin-jira-issue copied to clipboard
JQL query fails when results include a custom status
I've been using this plugin with Joplin for Windows (10 and 11) for a while, and now moved to macOS (12.3.1 and 12.4).
I've added the following snippet to my Joplin note:
status not in (Done, Obsolete) AND assignee in (currentUser()) order by created DESC
I verified this query successfully retrieves results within Jira's UI, and this worked just fine on Joplin for Windows as well.
Now on Joplin for macOS, the same query returns the error:
Error: The status with id 'Requires More Detail' does not exist
If I remove the status filter from my query - it still fails with the same error.
If I remove the order by from my query - it still fails with the same error.
Only if I remove both, and only use the query assignee in (currentUser()) - it successfully returns results.
I should mention that one of the projects I'm associated with has custom statuses we've added ('Requires More Detail' and 'To Be Scheduled'), and if I exclude them from the search, it succeeds:
status not in (Done, Obsolete, "Requires More Detail", "To Be Scheduled") AND assignee in (currentUser()) order by created DESC
I've tested this with both the ```jira-search syntax and the <JiraSearch jql="status not in... syntax, getting the same result.

The error you get is generated by Jira and not the plugin. Can you call the JIRA API with the query that is generating the error in order to let me know what is the output you get?
https://your.jira.server/rest/api/latest/search?jql=status%20not%20in%20(Done%2C%20Obsolete)%20AND%20assignee%20in%20(currentUser())%20order%20by%20created%20DESC
@marc0l92 thank you for your response, When plugging in this URL (with my jira server URL) into Postman, and providing the appropriate Auth (Basic Auth, username is my email address, password is my Jira API Key, the same credentials I configured in Joplin's Jira Issue plugin settings), I'm able to get the expected results, no errors).

Thanks for the test. Can you retry the same call and send me the screenshot of the response in the section where the status is showed?
I need to ask you also another api call:
https://your.jira.server/rest/api/latest/status/Requires%20More%20Detail
I think the issue is in the API that gets the status color. I will change the code in order to use a default gray in case the API to get the actual color fails.
Try to update the plugin to 2.4.0
Thank you @marc0l92! Updating to 2.4.0 appears to have solved the issue. Do you still need me to provide you with the requested information above for troubleshooting the color issue?
The fix I did is to use the gray color in case I'm not able to get the real status color.
It will be useful for me if you do this test so I can fix the code and show the real status color