How to programmatically construct textual query
- by stibi
Here is a query language, more specifically, it's JQL, you can use it in Jira, to search for issues, it's something like SQL, but quite simpler.
My case is that, I need to construct such queries programmatically, in my application.
Something like:
JQLMachine jqlMachine = new JQLMachine()
jqlMachine.setStatuses("Open", "In Progress")
jqlMachine.setReporter("foouser", "baruser")
jqlMachine.setDateRange(...)
jqlMachine.getQuery() --> String with corresponding JQL query is returned
You get my point I hope. I can imagine the code for this, but it's not nice, using my current knowledge how I'd do that.
That's why I'm asking. What you'd advice to use to create such thing. I believe some patterns for creating something like this already exist and there is already best practices, how to do that in good way.