I'm building a custom report with the JIRA SDK. However, I have difficulties to build a query using the worklogAuthor. I would like to do something like:
Query q = jqlClauseBuilder.addStringCondition("worklogAuthor",Operator.EQUALS,"admin").buildQuery();
But it throws an error. Can someone help me?
Hello @Lisanne Nauta
Do you really need to use jqlClauseBuilder?
Try to use jqlParser instead
import com.atlassian.jira.component.ComponentAccessor;
import com.atlassian.jira.issue.search.SearchProvider
import com.atlassian.jira.jql.parser.JqlQueryParser
import com.atlassian.jira.web.bean.PagerFilter
def jqlQueryParser = ComponentAccessor.getComponent(JqlQueryParser)
def searchProvider = ComponentAccessor.getComponent(SearchProvider)
def user = ComponentAccessor.getJiraAuthenticationContext().getLoggedInUser()
// jql query to sum fields
def query = jqlQueryParser.parseQuery("worklogAuthor = admin")
//get results
def results = searchProvider.search(query, user, PagerFilter.getUnlimitedFilter())
This seems to work properly. But the query jqlClauseBuilder.addStringCondition("worklogAuthor","admin").buildQuery(); failed. Should also be posible.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.