Hello!
Please help me to write JQLQuery which will be equivalent to real-query :
project="PROJECT" AND issuetype = Bug AND status was in ("RESOLVED") before 2012-03-06
At this time I build JQLQuery
queryBuilder.where().project(PROJECT_ID).and().issueType("Bug").and().status(RESOLVED)
How I can realize part: before 2012-03-06 ?
Thanks!
Try lt (less than) operator for before.
Alternatively, you can write the query as a String a parse it to a Query object.
Here's some sample code for a plugin I've just written that takes JQL string. Easier than working our the train-carriage approach of building the query.
final UserUtil userUtil = ComponentManager.getInstance().getUserUtil();
String serviceAccountName = "SERVICE_ACC_NAME";
User serviceAccount = userUtil.getUser(serviceAccountName);
String jqlQuery ="projec;t="PROJECT" AND issuetype = Bug AND status was in ("RESOLVED") before 2012-03-06"
SearchService.ParseResult parseResult = searchService.parseQuery(serviceAccount, jqlQuery);
assert parseResult.isValid() : "Invalid JQL, can't parse: " + jqlQuery;
final SearchResults results = searchService.search(serviceAccount, parseResult.getQuery(), PagerFilter.getUnlimitedFilter());
List<Issue> issueList = results.getIssues();
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.