Hello. Is there any way (api, function…) to know if a JQL is complex or not? I’m using @atlassianlabs/jql-editor-forge to search by JQL
Welcome to the Atlassian developer community @CamilaAraldi.
How do you mean “complex”? What is the effect you are trying to reduce or avoid?
I’m trying to disable basic search when my JQL is complex, as in the issue screen.
By definition in Jira, a JQL is “complex” when the scope of the JQL is not limited to a project or a set of projects or if uses a
OR keyword without delimiting the search. Having
OR without any parenthesis delimiting conditions or not searching among specific projects causes Jira to search in the entire site.
If you would like to share an example JQL that is causing issues we can point you in the right direction to make it “non-complex”, however those are the common scenarios that would cause them to search the entire site (thus making them complex).
So, my JQL is going to be dynamically (the user will write it). But one that made me confused is something like: project = KEY AND project = KEY, this is a complex query in the issue screen, and I didn’t know any way to validate this.