pypika icon indicating copy to clipboard operation
pypika copied to clipboard

Initial support for JQL

Open doc-sheet opened this issue 2 years ago • 6 comments

Hello.

There is some basic support for JQL, could you suggest some impovements?

For now it produces

project IN ("PROJ1","PROJ2") AND issuetype="My issue" AND (labels is EMPTY OR labels NOT IN ("stale","bug")) AND Привет is EMPTY AND repos is not EMPTY AND repos NOT IN ("main","dev")

for a query like this

J = JiraTable()
j = (
    JiraQueryBuilder()
    .where(J.project.isin(["PROJ1", "PROJ2"]))
    .where(J.issuetype == "My issue")
    .where(J.labels.isempty() | J.labels.notin(["stale", "bug"]))
    .where(getattr(J, "Привет").isempty())
    .where(J.repos.notempty() & J.repos.notin(["main", "dev"]))
)
print(j.get_sql())

doc-sheet avatar Mar 25 '23 15:03 doc-sheet

By JQL do you mean the selection in Jira or does it have more meanings?

AzisK avatar Sep 22 '23 07:09 AzisK

Could you add tests?

AzisK avatar Sep 22 '23 07:09 AzisK

By JQL do you mean the selection in Jira or does it have more meanings? Yeah, jql as jira query language

I din't aim for full support, just the tools I use myself. But I can add more if needed. I guess.

doc-sheet avatar Sep 24 '23 11:09 doc-sheet

I believe there is no need to start with full support. We can start little and then later extend it. Could you also add this possibility in the documentation?

AzisK avatar Sep 24 '23 13:09 AzisK

Sure! Done.

doc-sheet avatar Sep 24 '23 14:09 doc-sheet

ugh There was a dependency conflict in my venv: https://stackoverflow.com/a/71674345

doc-sheet avatar Sep 29 '23 22:09 doc-sheet