@NotThreadSafe public interface

JqlClauseBuilder

com.atlassian.jira.jql.builder.JqlClauseBuilder

Class Overview

A builder used to construct the Where Clause portion of a JQL Query in a fluent programming structure. JQL queries can be defined as one or more terminal clauses, seperated by logical operators, where terminal clauses define value conditions on specific fields.

This builder provided methods to build terminal clauses specific to system fields (e.g. reporter()) and short cuts for common terminal clauses (e.g. which produce the terminal clause {@code resolution = Unresolved. But also allows the programmer to define his terminal clause components manually, for example builder.field("cf[100]").in().strings("jql", "rocks").buildQuery(), this is useful for custom fields.

To build Where Clauses with more than one terminal clause, the logical operators must be defined by the programmer between each call to a terminal clause method, or a default operator must be set. For example to produce the JQL project = HSP and issuetype = bug the builder would be used as such builder.project("HSP").and().issueType("bug").buildQuery() or builder.defaultAnd().project("HSP").issueType("bug").buildQuery(). Not defining the operator, such as builder.project("HSP").issueType("bug").buildQuery() will cause an illegal state exception.

Different logical operators can be specified by the programmer by using the ConditionBuilder returned by the field level methods such as project(). For instance to create the terminal clause component != searching the programmer would use the builder as such builder.component().notEq().string("searching").

By default the builder uses the standard order of precedence. However if the programmer wishes to define their own order, they can make use of the sub() and endsub() methods, which effectively add opening and closing parenthesis to the JQL respectively. For instance to create the JQL (resolution is unresolved and assignee is empty) or resolution = fixed the programmer would use the builder as such builder.sub().field("resolution").and.assigneeIsEmpty().endsub().or().resolution().eq("fixed")

Generally, it is not possible to passs nulls, empty collections, empty arrays, collections that contain nulls, or arrays that contain nulls to the method on the interface. Any exceptions to these argument conditions are documented on the method concern. Passing a method a bad argument will result in a IllegalArgumentException.

JQL values are of two types String and Long. For fields that are resolvable by both Id's and Names (e.g. projects, versions, issue types, components, options etc), the order of resolution depends on the value type. If the JQL value type is long, JIRA will first attempt to find the domain object by Id, if that fails, it will attempt to find the domain object by name with the string value of the long. If the JQL value type is a String, JIRA will first try to find the domain object by name, if that fails AND the string can be parsed into a number, JIRA attempts to find the domain object by id with that number.

Summary

Public Methods
JqlClauseBuilder addClause(Clause clause)
Add the passed JQL condition to the query being built.
JqlClauseBuilder addCondition(String clauseName, Operator operator, Operand operand)
Add the JQL condition clauseName operator operand to the query being built.
JqlClauseBuilder addCondition(String clauseName, Operand... operands)
Add the JQL condition clauseName in (operands) to the query being built.
ConditionBuilder addCondition(String clauseName)
Return a ConditionBuilder that can be used to build a JQL condition for the passed JQL name.
JqlClauseBuilder addCondition(String clauseName, Operator operator, Collection<? extends Operand> operands)
Add the JQL condition clauseName operator (operands) to the query being built.
JqlClauseBuilder addCondition(String clauseName, Operand operand)
Add the JQL condition clauseName = operand to the query being built.
JqlClauseBuilder addCondition(String clauseName, Collection<? extends Operand> operands)
Add the JQL condition clauseName in (operands) to the query being built.
JqlClauseBuilder addCondition(String clauseName, Operator operator, Operand... operands)
Add the JQL condition clauseName operator (operands) to the query being built.
JqlClauseBuilder addDateCondition(String clauseName, Collection<Date> dates)
Add the JQL condition clauseName in (dates) to the query being built.
JqlClauseBuilder addDateCondition(String clauseName, Operator operator, Date... dates)
Add the JQL condition clauseName operator (clauseValues) to the query being built.
JqlClauseBuilder addDateCondition(String clauseName, Date... dates)
Add the JQL condition clauseName in (dates) to the query being built.
JqlClauseBuilder addDateCondition(String clauseName, Operator operator, Collection<Date> dates)
Add the JQL condition clauseName operator (clauseValues) to the query being built.
JqlClauseBuilder addDateCondition(String clauseName, Operator operator, Date date)
Add the JQL condition clausename operator date to the query being built.
JqlClauseBuilder addDateRangeCondition(String clauseName, Date startDate, Date endDate)
Add a condition range condition to the current query for the passed dates.
JqlClauseBuilder addEmptyCondition(String clauseName)
Add an "IS EMPTY" condition to the current query for the passed JQL clause.
JqlClauseBuilder addFunctionCondition(String clauseName, Operator operator, String functionName)
Add the JQL condition clauseName operator functionName() to the query being built.
JqlClauseBuilder addFunctionCondition(String clauseName, String functionName)
Add the JQL condition clauseName = functionName() to the query being built.
JqlClauseBuilder addFunctionCondition(String clauseName, String functionName, Collection<String> args)
Add the JQL condition clauseName = functionName(arg1, arg2, arg3, ..., argN) to the query being built.
JqlClauseBuilder addFunctionCondition(String clauseName, String functionName, String... args)
Add the JQL condition clauseName = functionName(arg1, arg2, arg3, ..., argN) to the query being built.
JqlClauseBuilder addFunctionCondition(String clauseName, Operator operator, String functionName, String... args)
Add the JQL condition clauseName operator functionName(arg1, arg2, arg3, ..., argN) to the query being built.
JqlClauseBuilder addFunctionCondition(String clauseName, Operator operator, String functionName, Collection<String> args)
Add the JQL condition clauseName operator functionName(arg1, arg2, arg3, ..., argN) to the query being built.
JqlClauseBuilder addNumberCondition(String clauseName, Operator operator, Long clauseValue)
Add the JQL condition clauseName operator clauseValue to the query being built.
JqlClauseBuilder addNumberCondition(String clauseName, Operator operator, Long... clauseValues)
Add the JQL condition clauseName operator (clauseValues) to the query being built.
JqlClauseBuilder addNumberCondition(String clauseName, Operator operator, Collection<Long> clauseValues)
Add the JQL condition clauseName operator (clauseValues) to the query being built.
JqlClauseBuilder addNumberCondition(String clauseName, Long clauseValue)
Add the JQL condition clauseName = clauseValue to the query being built.
JqlClauseBuilder addNumberCondition(String clauseName, Long... clauseValues)
Add the JQL condition clauseName in (clauseValues) to the query being built.
JqlClauseBuilder addNumberCondition(String clauseName, Collection<Long> clauseValues)
Add the JQL condition clauseName in (clauseValues) to the query being built.
JqlClauseBuilder addNumberRangeCondition(String clauseName, Long start, Long end)
Add a condition range condition to the current query for the passed values.
JqlClauseBuilder addRangeCondition(String clauseName, Operand start, Operand end)
Add a condition range condition to the current query for the passed values.
JqlClauseBuilder addStringCondition(String clauseName, Operator operator, Collection<String> clauseValues)
Add the JQL condition clauseName operator (clauseValues) to the query being built.
JqlClauseBuilder addStringCondition(String clauseName, Operator operator, String... clauseValues)
Add the JQL condition clauseName operator (clauseValues) to the query being built.
JqlClauseBuilder addStringCondition(String clauseName, Collection<String> clauseValues)
Add the JQL condition clauseName in (clauseValues) to the query being built.
JqlClauseBuilder addStringCondition(String clauseName, String... clauseValues)
Add the JQL condition clauseName in (clauseValues) to the query being built.
JqlClauseBuilder addStringCondition(String clauseName, String clauseValue)
Add the JQL condition clauseName = "clauseValue" to the query being built.
JqlClauseBuilder addStringCondition(String clauseName, Operator operator, String clauseValue)
Add the JQL condition clauseName operator "clauseValue" to the query being built.
JqlClauseBuilder addStringRangeCondition(String clauseName, String start, String end)
Add a condition range condition to the current query for the passed values.
JqlClauseBuilder affectedVersion(String version)
Add a condtion to the query that finds the issues associated with a particular affected version.
ConditionBuilder affectedVersion()
Return a ConditionBuilder that can be used to build a JQL condition for the affected version.
JqlClauseBuilder affectedVersion(String... versions)
Add a condition to the query that finds the issues associated particular set of affected versions.
JqlClauseBuilder affectedVersionIsEmpty()
Adds adds a condition to the query to find issues with no assigned affected version.
JqlClauseBuilder and()
Add the JQL "AND" operator to the JQL expression currently being built.
ConditionBuilder assignee()
Return a ConditionBuilder that can be used to build a JQL condition for the issue's assignee.
JqlClauseBuilder assigneeInGroup(String groupName)
Add a condition to the query that finds all issues that are assigned to users in a particular group.
JqlClauseBuilder assigneeIsCurrentUser()
Add a condition to the query that finds all issues that are assigned to the current user.
JqlClauseBuilder assigneeIsEmpty()
Add a condition to the query to find all unassigned issues.
JqlClauseBuilder assigneeUser(String userName)
Add a condition to the query that finds issues that are assigned to the passed user.
Clause buildClause()
Create the JQL clause the builder has currently constructed.
Query buildQuery()
Call this method to build a Query using the current builder.
ConditionBuilder category()
Return a ConditionBuilder that can be used to build a JQL condition for issue's in a particular project category.
JqlClauseBuilder category(String... categories)
Add a condition to the query that finds the issues from projects within a list of project categories.
JqlClauseBuilder clear()
Reset the builder to its empty state.
JqlClauseBuilder comment(String value)
Add a condition to the query that finds the issues that match the passed comment.
ConditionBuilder comment()
Return a ConditionBuilder that can be used to build a JQL condition for issue comments.
JqlClauseBuilder component(Long... components)
Add a condition to the query to find all issues with particular components.
JqlClauseBuilder component(String... components)
Add a condition to the query to find all issues with particular components.
ConditionBuilder component()
Return a ConditionBuilder that can be used to build a JQL condition for the issue's component.
JqlClauseBuilder componentIsEmpty()
Add a condition to the query to find all issues that have not component assigned.
ConditionBuilder created()
Return a ConditionBuilder that can be used to build a JQL condition for issue's creation date.
JqlClauseBuilder createdAfter(String startDate)
Add a condition to the query that finds the issues that were created after the passed date.
JqlClauseBuilder createdAfter(Date startDate)
Add a condition to the query that finds the issues that were created after the passed date.
JqlClauseBuilder createdBetween(String startDateString, String endDateString)
Add a condition to the query that finds the issues that where created between the passed dates.
JqlClauseBuilder createdBetween(Date startDate, Date endDate)
Add a condition to the query that finds the issues that where created between the passed dates.
ConditionBuilder currentEstimate()
Return a ConditionBuilder that can be used to build a JQL condition for the issue's current estimate.
ConditionBuilder customField(Long id)
Return a ConditionBuilder that can be used to build a JQL condition for a custom field with the passed id.
JqlClauseBuilder defaultAnd()
Tell the builder to combine JQL conditions using the "AND" operator when none has been specified.
JqlClauseBuilder defaultNone()
Tell the builder to stop injecting JQL "AND" or "OR" operators automatically between the generated JQL conditions.
JqlClauseBuilder defaultOr()
Tell the builder to combine JQL conditions using the "OR" operator when none has been specified.
ConditionBuilder description()
Return a ConditionBuilder that can be used to build a JQL condition for issue descriptions.
JqlClauseBuilder description(String value)
Add a condition to the query that finds the issues that match the passed description.
JqlClauseBuilder descriptionIsEmpty()
Add a condition to the query that finds the issues that have no description.
ConditionBuilder due()
Return a ConditionBuilder that can be used to build a JQL condition for issue's due date.
JqlClauseBuilder dueAfter(Date startDate)
Add a condition to the query that finds the issues that are due after the passed date.
JqlClauseBuilder dueAfter(String startDate)
Add a condition to the query that finds the issues that are due after the passed date.
JqlClauseBuilder dueBetween(String startDateString, String endDateString)
Add a condition to the query that finds the issues that where due between the passed dates.
JqlClauseBuilder dueBetween(Date startDate, Date endDate)
Add a condition to the query that finds the issues that where due between the passed dates.
JqlQueryBuilder endWhere()
Call this to get a handle on the associated JqlQueryBuilder.
JqlClauseBuilder endsub()
End the current sub JQL expression.
JqlClauseBuilder environment(String value)
Add a condition to the query that finds the issues that match the passed environment.
ConditionBuilder environment()
Return a ConditionBuilder that can be used to build a JQL condition for issue environments.
JqlClauseBuilder environmentIsEmpty()
Add a condition to the query that finds the issues that have no environment.
ConditionBuilder field(String jqlName)
Return a ConditionBuilder that can be used to build a JQL condition for the passed name.
JqlClauseBuilder fixVersion(String... versions)
Add a condition to the query that finds the issues associated particular set of fix versions.
JqlClauseBuilder fixVersion(Long... versions)
Add a condition to the query that finds the issues associated particular set of fix versions.
JqlClauseBuilder fixVersion(String version)
Add a condtion to the query that finds the issues associated with a particular fix version.
JqlClauseBuilder fixVersion(Long version)
Add a condtion to the query that finds the issues associated with a particular fix version.
ConditionBuilder fixVersion()
Return a ConditionBuilder that can be used to build a JQL condition for the fix version.
JqlClauseBuilder fixVersionIsEmpty()
Adds adds a condition to the query to find issues with no assigned fix version.
JqlClauseBuilder issue(String... keys)
Add a condition to the query that will find all issues with the passed key.
ConditionBuilder issue()
Return a ConditionBuilder that can be used to build a JQL condition for the issue's id or key.
JqlClauseBuilder issueInHistory()
Add a condition to the query that will find all issues currently within the user's history.
JqlClauseBuilder issueInVotedIssues()
Add a condition to the query that will find all issues the user has voted on.
JqlClauseBuilder issueInWatchedIssues()
Add a condition to the query that will find all issues currently watched by the user.
ConditionBuilder issueParent()
Return a ConditionBuilder that can be used to build a JQL condition for the issue's parent.
JqlClauseBuilder issueParent(String... keys)
Add a condition to the query that will find all issues that have the passed issues as parents.
JqlClauseBuilder issueType(String... types)
Add a condition to the query that finds the issues of a particular type.
ConditionBuilder issueType()
Return a ConditionBuilder that can be used to build a JQL condition for issue types.
JqlClauseBuilder issueTypeIsStandard()
Add a condition to the query that finds the "standard" issue types.
JqlClauseBuilder issueTypeIsSubtask()
Add a condition to the query that finds the "sub-task" issue types.
ConditionBuilder labels()
Return a ConditionBuilder that can be used to build a JQL condition for the issue's labels.
JqlClauseBuilder labels(String... labels)
Add a condition to the query to find all issues with particular labels.
JqlClauseBuilder labelsIsEmpty()
Add a condition to the query to find all issues that have no labels.
ConditionBuilder lastViewed()
Return a ConditionBuilder that can be used to build a JQL condition for issue's last viewed date.
JqlClauseBuilder lastViewedAfter(String startDate)
Add a condition to the query that finds the issues that where viewed after the passed date (if issue is stored in history kept).
JqlClauseBuilder lastViewedAfter(Date startDate)
Add a condition to the query that finds the issues that where last viewed after the passed date (if issue is stored in history kept).
JqlClauseBuilder lastViewedBetween(String startDateString, String endDateString)
Add a condition to the query that finds the issues that where last viewed between the passed dates.
JqlClauseBuilder lastViewedBetween(Date startDate, Date endDate)
Add a condition to the query that finds the issues that where viewed between the passed dates.
JqlClauseBuilder level(String... levels)
Add a condition to the query that will find all issues with the passed security levels.
ConditionBuilder level()
Return a ConditionBuilder that can be used to build a JQL condition for the issue's security level.
JqlClauseBuilder not()
Add the JQL "NOT" operator to the JQL expression currently being built.
JqlClauseBuilder or()
Add the JQL "OR" operator to the JQL expression currently being built.
ConditionBuilder originalEstimate()
Return a ConditionBuilder that can be used to build a JQL condition for the issue's original estimate.
ConditionBuilder priority()
Return a ConditionBuilder that can be used to build a JQL condition for the priority.
JqlClauseBuilder priority(String... priorities)
Add a condition to the query that finds the issues associated particular set of priorities.
JqlClauseBuilder project(Long... pids)
Add a condition to the query that finds the issues within a particular project.
ConditionBuilder project()
Return a ConditionBuilder that can be used to build a JQL condition for an issue's project.
JqlClauseBuilder project(String... projects)
Add a condition to the query that finds the issues within a particular project.
ConditionBuilder reporter()
Return a ConditionBuilder that can be used to build a JQL condition for the issue's reporter.
JqlClauseBuilder reporterInGroup(String groupName)
Add a condition to the query that finds all issues that were reported by users in a particular group.
JqlClauseBuilder reporterIsCurrentUser()
Add a condition to the query that finds all issues that were reported by the current user.
JqlClauseBuilder reporterIsEmpty()
Add a condition to the query to find issues without a reporter.
JqlClauseBuilder reporterUser(String userName)
Add a condition to the query that finds issues that where reported by the passed user.
ConditionBuilder resolution()
Return a ConditionBuilder that can be used to build a JQL condition for resolution.
JqlClauseBuilder resolution(String... resolutions)
Add a condition to the query that finds the issues associated particular set of resolutions.
ConditionBuilder resolutionDate()
Return a ConditionBuilder that can be used to build a JQL condition for issue's resolution date.
JqlClauseBuilder resolutionDateAfter(Date startDate)
Add a condition to the query that finds the issues that were reolved after the passed date.
JqlClauseBuilder resolutionDateAfter(String startDate)
Add a condition to the query that finds the issues that were resolved after the passed date.
JqlClauseBuilder resolutionDateBetween(Date startDate, Date endDate)
Add a condition to the query that finds the issues that where resolved between the passed dates.
JqlClauseBuilder resolutionDateBetween(String startDateString, String endDateString)
Add a condition to the query that finds the issues that where resolved between the passed dates.
ConditionBuilder savedFilter()
Return a ConditionBuilder that can be used to add saved filters as conditions to the query.
JqlClauseBuilder savedFilter(String... filters)
Add a condition to the query that will inclue the results from the passed filters in the search.
ConditionBuilder status()
Return a ConditionBuilder that can be used to build a JQL condition for status.
JqlClauseBuilder status(String... statuses)
Add a condition to the query that finds the issues associated particular set of statuses.
JqlClauseBuilder sub()
Create a new sub expression in the current JQL.
ConditionBuilder summary()
Return a ConditionBuilder that can be used to build a JQL condition for issue summaries.
JqlClauseBuilder summary(String value)
Add a condition to the query that finds the issues match the passed summary.
ConditionBuilder timeSpent()
Return a ConditionBuilder that can be used to build a JQL condition for the issue's timespent field.
JqlClauseBuilder unresolved()
Add a condition to query that finds the issues that have not been resolved.
ConditionBuilder updated()
Return a ConditionBuilder that can be used to build a JQL condition for issue's updated date.
JqlClauseBuilder updatedAfter(Date startDate)
Add a condition to the query that finds the issues that were updated after the passed date.
JqlClauseBuilder updatedAfter(String startDate)
Add a condition to the query that finds the issues that were updated after the passed date.
JqlClauseBuilder updatedBetween(String startDateString, String endDateString)
Add a condition to the query that finds the issues that where updated between the passed dates.
JqlClauseBuilder updatedBetween(Date startDate, Date endDate)
Add a condition to the query that finds the issues that where updated between the passed dates.
ConditionBuilder voter()
Return a ConditionBuilder that can be used to build a JQL condition for the number of votes on an issue.
JqlClauseBuilder voterInGroup(String groupName)
Add a condition to the query that finds all issues that were voted for by users in a particular group.
JqlClauseBuilder voterIsCurrentUser()
Add a condition to the query that finds all issues that were voted for by the current user.
JqlClauseBuilder voterIsEmpty()
Add a condition to the query to find issues without any votes.
JqlClauseBuilder voterUser(String userName)
Add a condition to the query that finds issues that are voted for by the passed user.
ConditionBuilder votes()
Return a ConditionBuilder that can be used to build a JQL condition for the number of votes on an issue.
ConditionBuilder watcher()
Return a ConditionBuilder that can be used to build a JQL condition for the number of watches on an issue.
JqlClauseBuilder watcherInGroup(String groupName)
Add a condition to the query that finds all issues that were watched by users in a particular group.
JqlClauseBuilder watcherIsCurrentUser()
Add a condition to the query that finds all issues that were watched by the current user.
JqlClauseBuilder watcherIsEmpty()
Add a condition to the query to find issues without any watchers.
JqlClauseBuilder watcherUser(String userName)
Add a condition to the query that finds issues that are watched by the passed user.
ConditionBuilder watches()
Return a ConditionBuilder that can be used to build a JQL condition for the number of watches on an issue.
ConditionBuilder workRatio()
Return a ConditionBuilder that can be used to build a JQL condition for the issue's work ratio field.

Public Methods

public JqlClauseBuilder addClause (Clause clause)

Add the passed JQL condition to the query being built.

Parameters
clause the clause to add. Must not be null.
Returns
  • a reference to the current builder. Never null.
Throws
IllegalStateException if it is not possible to add a JQL condition given the current state of the builder.

public JqlClauseBuilder addCondition (String clauseName, Operator operator, Operand operand)

Add the JQL condition clauseName operator operand to the query being built.

Parameters
clauseName name of the clause in the condition. Must not be null.
operator one of the enumerated Operators. Must not be null.
operand defines an operand that will serve as the clause value. Must not be null.
Returns
  • a reference to the current builder.
Throws
IllegalStateException if it is not possible to add a JQL condition given the current state of the builder.

public JqlClauseBuilder addCondition (String clauseName, Operand... operands)

Add the JQL condition clauseName in (operands) to the query being built.

Parameters
clauseName name of the clause in the condition. Must not be null.
operands operands values for the condition. Must not be null, empty or contain any null values.
Returns
  • a reference to the current builder.
Throws
IllegalStateException if it is not possible to add a JQL condition given the current state of the builder.

public ConditionBuilder addCondition (String clauseName)

Return a ConditionBuilder that can be used to build a JQL condition for the passed JQL name.

Parameters
clauseName the name of the JQL condition to add.
Returns
  • a reference to a condition builder for the passed condition.

public JqlClauseBuilder addCondition (String clauseName, Operator operator, Collection<? extends Operand> operands)

Add the JQL condition clauseName operator (operands) to the query being built.

Parameters
clauseName name of the clause in the condition. Must not be null.
operator one of the enumerated Operators. Must not be null.
operands values for the condition. Must not be null, empty or contain any null values.
Returns
  • a reference to the current builder.
Throws
IllegalStateException if it is not possible to add a JQL condition given the current state of the builder.

public JqlClauseBuilder addCondition (String clauseName, Operand operand)

Add the JQL condition clauseName = operand to the query being built.

Parameters
clauseName name of the clause in the condition. Must not be null.
operand defines an operand that will serve as the clause value. Must not be null.
Returns
  • a reference to the current builder.
Throws
IllegalStateException if it is not possible to add a JQL condition given the current state of the builder.

public JqlClauseBuilder addCondition (String clauseName, Collection<? extends Operand> operands)

Add the JQL condition clauseName in (operands) to the query being built.

Parameters
clauseName name of the clause in the condition. Must not be null.
operands operands values for the condition. Must not be null, empty or contain any null values.
Returns
  • a reference to the current builder.
Throws
IllegalStateException if it is not possible to add a JQL condition given the current state of the builder.

public JqlClauseBuilder addCondition (String clauseName, Operator operator, Operand... operands)

Add the JQL condition clauseName operator (operands) to the query being built.

Parameters
clauseName name of the clause in the condition. Must not be null.
operator one of the enumerated Operators. Must not be null.
operands values for the condition. Must not be null, empty or contain any null values.
Returns
  • a reference to the current builder.
Throws
IllegalStateException if it is not possible to add a JQL condition given the current state of the builder.

public JqlClauseBuilder addDateCondition (String clauseName, Collection<Date> dates)

Add the JQL condition clauseName in (dates) to the query being built.

Parameters
clauseName name of the clause in the condition. Must not be null.
dates dates for the condition. Must not be null, empty or contain any null values.
Returns
  • a reference to the current builder.
Throws
IllegalStateException if it is not possible to add a JQL condition given the current state of the builder.

public JqlClauseBuilder addDateCondition (String clauseName, Operator operator, Date... dates)

Add the JQL condition clauseName operator (clauseValues) to the query being built.

Parameters
clauseName name of the clause in the condition. Must not be null.
operator one of the enumerated Operators. Must not be null.
dates date values for the condition. Must not be null, empty or contain any null values.
Returns
  • a reference to the current builder.
Throws
IllegalStateException if it is not possible to add a JQL condition given the current state of the builder.

public JqlClauseBuilder addDateCondition (String clauseName, Date... dates)

Add the JQL condition clauseName in (dates) to the query being built.

Parameters
clauseName name of the clause in the condition. Must not be null.
dates dates for the condition. Must not be null, empty or contain any null values.
Returns
  • a reference to the current builder.
Throws
IllegalStateException if it is not possible to add a JQL condition given the current state of the builder.

public JqlClauseBuilder addDateCondition (String clauseName, Operator operator, Collection<Date> dates)

Add the JQL condition clauseName operator (clauseValues) to the query being built.

Parameters
clauseName name of the clause in the condition. Must not be null.
operator one of the enumerated Operators. Must not be null.
dates date values for the condition. Must not be null, empty or contain any null values.
Returns
  • a reference to the current builder.
Throws
IllegalStateException if it is not possible to add a JQL condition given the current state of the builder.

public JqlClauseBuilder addDateCondition (String clauseName, Operator operator, Date date)

Add the JQL condition clausename operator date to the query being built.

Parameters
clauseName name of the clause in the condition. Must not be null.
operator one of the enumerated Operators. Must not be null.
date the date for the condition. Must not be null.
Returns
  • a reference to the current builder. Never null.
Throws
IllegalStateException if it is not possible to add a JQL condition given the current state of the builder.

public JqlClauseBuilder addDateRangeCondition (String clauseName, Date startDate, Date endDate)

Add a condition range condition to the current query for the passed dates. This essentially adds the query clauseName &gt;= startDate AND clauseName &lt;= endDate to the query being built.

It is also possible to create an open interval by passing one of the arguments as null. Passing a non-null startDate with a null endDate will add the condition clauseName &gt;= startDate. Passing a non-null endDate with a null startDate will add the condition clauseName &lt;= endDate. Passing a null startDate and null endDate is illegal.

Parameters
clauseName name of the clause in the condition. Must not be null.
startDate the date for the start of the range. May be null if endDate is not null.
endDate the date for the end of the range. May be null if startDate is not null.
Returns
  • a reference to the current builder.
Throws
IllegalStateException if it is not possible to add a JQL condition given the current state of the builder.
IllegalArgumentException if both startDate and endDate are null.

public JqlClauseBuilder addEmptyCondition (String clauseName)

Add an "IS EMPTY" condition to the current query for the passed JQL clause. This essentially adds the query clauseName IS EMPTY to the query being built.

Parameters
clauseName the clause name for the new condition. Cannot be null.
Returns
  • a reference to the current builder.
Throws
IllegalStateException if it is not possible to add a JQL condition given the current state of the builder.

public JqlClauseBuilder addFunctionCondition (String clauseName, Operator operator, String functionName)

Add the JQL condition clauseName operator functionName() to the query being built.

Parameters
clauseName name of the clause in the condition. Must not be null.
operator one of the enumerated Operators. Must not be null.
functionName name of the function to call. Must not be null.
Returns
  • a reference to the current builder. Never null.
Throws
IllegalStateException if it is not possible to add a JQL condition given the current state of the builder.

public JqlClauseBuilder addFunctionCondition (String clauseName, String functionName)

Add the JQL condition clauseName = functionName() to the query being built.

Parameters
clauseName name of the clause in the condition. Must not be null.
functionName name of the function to call. Must not be null.
Returns
  • a reference to the current builder. Never null.
Throws
IllegalStateException if it is not possible to add a JQL condition given the current state of the builder.

public JqlClauseBuilder addFunctionCondition (String clauseName, String functionName, Collection<String> args)

Add the JQL condition clauseName = functionName(arg1, arg2, arg3, ..., argN) to the query being built.

Parameters
clauseName name of the clause in the condition. Must not be null.
functionName name of the function to call. Must not be null.
args the arguments to add to the function. Must not be null or contain any null values.
Returns
  • a reference to the current builder. Never null.
Throws
IllegalStateException if it is not possible to add a JQL condition given the current state of the builder.

public JqlClauseBuilder addFunctionCondition (String clauseName, String functionName, String... args)

Add the JQL condition clauseName = functionName(arg1, arg2, arg3, ..., argN) to the query being built.

Parameters
clauseName name of the clause in the condition. Must not be null.
functionName name of the function to call. Must not be null.
args the arguments to add to the function. Must not be null or contain any null values.
Returns
  • a reference to the current builder. Never null.
Throws
IllegalStateException if it is not possible to add a JQL condition given the current state of the builder.

public JqlClauseBuilder addFunctionCondition (String clauseName, Operator operator, String functionName, String... args)

Add the JQL condition clauseName operator functionName(arg1, arg2, arg3, ..., argN) to the query being built.

Parameters
clauseName name of the clause in the condition. Must not be null.
operator one of the enumerated Operators. Must not be null.
functionName name of the function to call. Must not be null.
args the arguments to add to the function. Must not be null or contain any null values.
Returns
  • a reference to the current builder. Never null.
Throws
IllegalStateException if it is not possible to add a JQL condition given the current state of the builder.

public JqlClauseBuilder addFunctionCondition (String clauseName, Operator operator, String functionName, Collection<String> args)

Add the JQL condition clauseName operator functionName(arg1, arg2, arg3, ..., argN) to the query being built.

Parameters
clauseName name of the clause in the condition. Must not be null.
operator one of the enumerated Operators. Must not be null.
functionName name of the function to call. Must not be null.
args the arguments to add to the function. Must not be null or contain any null values.
Returns
  • a reference to the current builder. Never null.
Throws
IllegalStateException if it is not possible to add a JQL condition given the current state of the builder.

public JqlClauseBuilder addNumberCondition (String clauseName, Operator operator, Long clauseValue)

Add the JQL condition clauseName operator clauseValue to the query being built.

Parameters
clauseName name of the clause in the condition. Must not be null.
operator one of the enumerated Operators. Must not be null.
clauseValue long value for the condition. Must not be null.
Returns
  • a reference to the current builder.
Throws
IllegalStateException if it is not possible to add a JQL condition given the current state of the builder.

public JqlClauseBuilder addNumberCondition (String clauseName, Operator operator, Long... clauseValues)

Add the JQL condition clauseName operator (clauseValues) to the query being built.

Parameters
clauseName name of the clause in the condition. Must not be null.
operator one of the enumerated Operators. Must not be null.
clauseValues long values for the condition. Must not be null, empty or contain any null values.
Returns
  • a reference to the current builder.
Throws
IllegalStateException if it is not possible to add a JQL condition given the current state of the builder.

public JqlClauseBuilder addNumberCondition (String clauseName, Operator operator, Collection<Long> clauseValues)

Add the JQL condition clauseName operator (clauseValues) to the query being built.

Parameters
clauseName name of the clause in the condition. Must not be null.
operator one of the enumerated Operators. Must not be null.
clauseValues long values for the condition. Must not be null, empty or contain any null values.
Returns
  • a reference to the current builder.
Throws
IllegalStateException if it is not possible to add a JQL condition given the current state of the builder.

public JqlClauseBuilder addNumberCondition (String clauseName, Long clauseValue)

Add the JQL condition clauseName = clauseValue to the query being built.

Parameters
clauseName name of the clause in the condition. Must not be null.
clauseValue long value for the condition. Must not be null.
Returns
  • a reference to the current builder.
Throws
IllegalStateException if it is not possible to add a JQL condition given the current state of the builder.

public JqlClauseBuilder addNumberCondition (String clauseName, Long... clauseValues)

Add the JQL condition clauseName in (clauseValues) to the query being built.

Parameters
clauseName name of the clause in the condition. Must not be null.
clauseValues long values. Must not be null, empty or contain any null values.
Returns
  • a reference to the current builder.
Throws
IllegalStateException if it is not possible to add a JQL condition given the current state of the builder.

public JqlClauseBuilder addNumberCondition (String clauseName, Collection<Long> clauseValues)

Add the JQL condition clauseName in (clauseValues) to the query being built.

Parameters
clauseName name of the clause in the condition. Must not be null.
clauseValues long values for the condition. Must not be null, empty or contain any null values.
Returns
  • a reference to the current builder.
Throws
IllegalStateException if it is not possible to add a JQL condition given the current state of the builder.

public JqlClauseBuilder addNumberRangeCondition (String clauseName, Long start, Long end)

Add a condition range condition to the current query for the passed values. This essentially adds the query clauseName &gt;= start AND clauseName &lt;= end to the query being built.

It is also possible to create an open interval by passing one of the arguments as null. Passing a non-null start with a null end will add the condition clauseName &gt;= start. Passing a non-null end with a null start will add the condition clauseName &lt;= end. Passing a null start and null end is illegal.

Parameters
clauseName name of the clause in the condition. Must not be null.
start the start of the range. May be null if end is not null.
end the end of the range. May be null if start is not null.
Returns
  • a reference to the current builder.
Throws
IllegalStateException if it is not possible to add a JQL condition given the current state of the builder.
IllegalArgumentException if both start and end are null.

public JqlClauseBuilder addRangeCondition (String clauseName, Operand start, Operand end)

Add a condition range condition to the current query for the passed values. This essentially adds the query clauseName &gt;= start AND clauseName &lt;= end to the query being built.

It is also possible to create an open interval by passing one of the arguments as null. Passing a non-null start with a null end will add the condition clauseName &gt;= start. Passing a non-null end with a null start will add the condition clauseName &lt;= end. Passing a null start and null end is illegal.

Parameters
clauseName name of the clause in the condition. Must not be null.
start the start of the range. May be null if end is not null.
end the end of the range. May be null if start is not null.
Returns
  • a reference to the current builder.
Throws
IllegalStateException if it is not possible to add a JQL condition given the current state of the builder.
IllegalArgumentException if both start and end are null.

public JqlClauseBuilder addStringCondition (String clauseName, Operator operator, Collection<String> clauseValues)

Add the JQL condition clauseName operator (clauseValues) to the query being built.

Parameters
clauseName name of the clause in the condition. Must not be null.
operator one of the enumerated Operators. Must not be null.
clauseValues string values for the condition. Must not be null, empty or contain any null values.
Returns
  • a reference to the current builder.
Throws
IllegalStateException if it is not possible to add a JQL condition given the current state of the builder.

public JqlClauseBuilder addStringCondition (String clauseName, Operator operator, String... clauseValues)

Add the JQL condition clauseName operator (clauseValues) to the query being built.

Parameters
clauseName name of the clause in the condition. Must not be null.
operator one of the enumerated Operators. Must not be null.
clauseValues string values for the condition. Must not be null, empty or contain any null values.
Returns
  • a reference to the current builder.
Throws
IllegalStateException if it is not possible to add a JQL condition given the current state of the builder.

public JqlClauseBuilder addStringCondition (String clauseName, Collection<String> clauseValues)

Add the JQL condition clauseName in (clauseValues) to the query being built.

Parameters
clauseName name of the clause in the condition. Must not be null.
clauseValues string values for the condition. Must not be null, empty or contain any null values.
Returns
  • a reference to the current builder.
Throws
IllegalStateException if it is not possible to add a JQL condition given the current state of the builder.

public JqlClauseBuilder addStringCondition (String clauseName, String... clauseValues)

Add the JQL condition clauseName in (clauseValues) to the query being built.

Parameters
clauseName name of the clause in the condition. Must not be null.
clauseValues string values for the condition. Must not be null, empty or contain any null values.
Returns
  • a reference to the current builder.
Throws
IllegalStateException if it is not possible to add a JQL condition given the current state of the builder.

public JqlClauseBuilder addStringCondition (String clauseName, String clauseValue)

Add the JQL condition clauseName = "clauseValue" to the query being built.

Parameters
clauseName name of the clause in the condition. Must not be null.
clauseValue string value for the condition. Must not be null.
Returns
  • a reference to the current builder. Never null.
Throws
IllegalStateException if it is not possible to add a JQL condition given the current state of the builder.

public JqlClauseBuilder addStringCondition (String clauseName, Operator operator, String clauseValue)

Add the JQL condition clauseName operator "clauseValue" to the query being built.

Parameters
clauseName name of the clause in the condition. Must not be null.
operator one of the enumerated Operators. Must not be null.
clauseValue string value for the condition. Must not be null.
Returns
  • a reference to the current builder.
Throws
IllegalStateException if it is not possible to add a JQL condition given the current state of the builder.

public JqlClauseBuilder addStringRangeCondition (String clauseName, String start, String end)

Add a condition range condition to the current query for the passed values. This essentially adds the query clauseName &gt;= start AND clauseName &lt;= end to the query being built.

It is also possible to create an open interval by passing one of the arguments as null. Passing a non-null start with a null end will add the condition clauseName &gt;= start. Passing a non-null end with a null start will add the condition clauseName &lt;= end. Passing a null start and null end is illegal.

Parameters
clauseName name of the clause in the condition. Must not be null.
start the start of the range. May be null if end is not null.
end the end of the range. May be null if start is not null.
Returns
  • a reference to the current builder.
Throws
IllegalStateException if it is not possible to add a JQL condition given the current state of the builder.
IllegalArgumentException if both start and end are null.

public JqlClauseBuilder affectedVersion (String version)

Add a condtion to the query that finds the issues associated with a particular affected version. This essentially adds the JQL condition affectedVersion = "value" to the query being built.

Parameters
version the version to search for. Can be passed as its name (e.g. "1.2") or the string representation of its internal JIRA ID (e.g. "102020"). Must not be null.
Returns
  • a reference to the current builder.
Throws
IllegalStateException if it is not possible to add a JQL condition given the current state of the builder.

public ConditionBuilder affectedVersion ()

Return a ConditionBuilder that can be used to build a JQL condition for the affected version.

Returns
  • a reference to a condition builder for affected version.

public JqlClauseBuilder affectedVersion (String... versions)

Add a condition to the query that finds the issues associated particular set of affected versions. This essentially adds the JQL condition affectedVersion in (versions) to the query being built.

Parameters
versions the affected versions to search for. Each version can be specified either by its name (e.g. "1.2") or by its JIRA ID as a string (e.g. "10000"). Must not be null, empty or contain any null values.
Returns
  • a reference to the current builder.
Throws
IllegalStateException if it is not possible to add a JQL condition given the current state of the builder.

public JqlClauseBuilder affectedVersionIsEmpty ()

Adds adds a condition to the query to find issues with no assigned affected version. This essentially adds the JQL condition affectedVersion IS EMPTY to the query being built.

Returns
  • a reference to the current builder.
Throws
IllegalStateException if it is not possible to add a JQL condition given the current state of the builder.

public JqlClauseBuilder and ()

Add the JQL "AND" operator to the JQL expression currently being built. The builder takes into account operator precendence when generating the JQL expression, and as such, the caller may need to group JQL conditions using the sub() and endsub() calls. For example, builder.not().affectedVersion("11").and().effectedVersion("12") produces the JQL NOT (affectedVersion = "11") and affectedVersion = "12" as the "NOT" operator has a higher precedence than "AND". On the other hand, builder.not().sub().affectedVersion("11").and().effectedVersion("12").endsub() produces the JQL NOT(affectedVersion = "11" andaffectedVersion = "12").

Returns
  • a reference to the current builder.
Throws
IllegalStateException if it is not possible to add the AND operator given the current state of the builder.

public ConditionBuilder assignee ()

Return a ConditionBuilder that can be used to build a JQL condition for the issue's assignee.

Returns
  • a reference to a ConditionBuilder for assignee.

public JqlClauseBuilder assigneeInGroup (String groupName)

Add a condition to the query that finds all issues that are assigned to users in a particular group. This essentially adds the condition assignee in memboersOf("groupName") to the query being built.

Parameters
groupName the group for the condition. Cannot be null.
Returns
  • a reference to the current builder.
Throws
IllegalStateException if it is not possible to add a JQL condition given the current state of the builder.

public JqlClauseBuilder assigneeIsCurrentUser ()

Add a condition to the query that finds all issues that are assigned to the current user. This essentially adds the condition assignee = currentUser() to the query being built.

Returns
  • a reference to the current builder.
Throws
IllegalStateException if it is not possible to add a JQL condition given the current state of the builder.

public JqlClauseBuilder assigneeIsEmpty ()

Add a condition to the query to find all unassigned issues. This essentially adds the condition assignee IS EMPTY to the query being built.

Returns
  • a reference to the current builder.
Throws
IllegalStateException if it is not possible to add a JQL condition given the current state of the builder.

public JqlClauseBuilder assigneeUser (String userName)

Add a condition to the query that finds issues that are assigned to the passed user. This essentially adds the condition assignee = userName to the query being built.

Parameters
userName the username to search for. Cannot be null.
Returns
  • a reference to the current builder.
Throws
IllegalStateException if it is not possible to add a JQL condition given the current state of the builder.

public Clause buildClause ()

Create the JQL clause the builder has currently constructed. The builder can still be used after this method is called.

Returns
  • the clause generated by the builder. Can be null if there is no clause to generate.
Throws
IllegalStateException if it is not possible to build a valid JQL query given the state of the builder.

public Query buildQuery ()

Call this method to build a Query using the current builder. When endWhere() is not null, this equates to calling endWhere().buildQuery(). When endWhere() is null, this equates to calling new QueryImpl(buildClause()).

Returns
  • the newly generated query query.
Throws
IllegalStateException if it is not possible to build the current query given the state of the builder.

public ConditionBuilder category ()

Return a ConditionBuilder that can be used to build a JQL condition for issue's in a particular project category. An issue is in a project category only when it is in a project that is part of the category.

Returns
  • a reference to a ConditionBuilder for project category.

public JqlClauseBuilder category (String... categories)

Add a condition to the query that finds the issues from projects within a list of project categories. This essentially adds the JQL condition category in (categories) to the query being built.

Parameters
categories the JIRA project categories for the condition. Each project can be specified by its name (e.g. "Atlassian Products") or by its JIRA ID as a string (e.g. "10000"). Must not be null, empty or contain any null values.
Returns
  • a reference to the current builder.
Throws
IllegalStateException if it is not possible to add a JQL condition given the current state of the builder.

public JqlClauseBuilder clear ()

Reset the builder to its empty state.

Returns
  • the reset builder.

public JqlClauseBuilder comment (String value)

Add a condition to the query that finds the issues that match the passed comment. This essentially adds the condition comment ~ "value" to the query being built.

NOTE: The comment field performs apporximate text matching not exact text matching.

Parameters
value the value of the condition.
Returns
  • a reference to the current builder.
Throws
IllegalStateException if it is not possible to add a JQL condition given the current state of the builder.

public ConditionBuilder comment ()

Return a ConditionBuilder that can be used to build a JQL condition for issue comments.

Returns
  • a reference to a ConditionBuilder for issue comments.

public JqlClauseBuilder component (Long... components)

Add a condition to the query to find all issues with particular components. This essentially adds the JQL condition component in (components) to the query.

Parameters
components the ids of the components to search for. Must not be null, contain nulls or be empty.
Returns
  • a reference to the current builder.
Throws
IllegalStateException if it is not possible to add a JQL condition given the current state of the builder.

public JqlClauseBuilder component (String... components)

Add a condition to the query to find all issues with particular components. This essentially adds the JQL condition component in (components) to the query.

Parameters
components the JIRA components to search for. Each component can be specified by its name (e.g. "Web") or by its JIRA ID as a string (e.g. "10000"). Must not be null, empty or contain any null values.
Returns
  • a reference to the current builder.
Throws
IllegalStateException if it is not possible to add a JQL condition given the current state of the builder.

public ConditionBuilder component ()

Return a ConditionBuilder that can be used to build a JQL condition for the issue's component.

Returns
  • a reference to a ConditionBuilder for component.

public JqlClauseBuilder componentIsEmpty ()

Add a condition to the query to find all issues that have not component assigned. This essentially adds the JQL condition component IS EMTPY to the query.

Returns
  • a reference to the current builder.
Throws
IllegalStateException if it is not possible to add a JQL condition given the current state of the builder.

public ConditionBuilder created ()

Return a ConditionBuilder that can be used to build a JQL condition for issue's creation date.

Returns
  • a reference to a ConditionBuilder for created date.

public JqlClauseBuilder createdAfter (String startDate)

Add a condition to the query that finds the issues that were created after the passed date. This essentially adds the query created &gt;= startDate to the query being built.

Parameters
startDate the date that issues must be created after. Can be a date (e.g. "2008-10-23") or a period (e.g. "-3w"). Cannot be null.
Returns
  • a reference to the current builder.
Throws
IllegalStateException if it is not possible to add a JQL condition given the current state of the builder.

public JqlClauseBuilder createdAfter (Date startDate)

Add a condition to the query that finds the issues that were created after the passed date. This essentially adds the query created &gt;= startDate to the query being built.

Parameters
startDate the date that issues must be created after. Cannot be null.
Returns
  • a reference to the current builder.
Throws
IllegalStateException if it is not possible to add a JQL condition given the current state of the builder.

public JqlClauseBuilder createdBetween (String startDateString, String endDateString)

Add a condition to the query that finds the issues that where created between the passed dates. This essentially adds the query created &gt;= startDateString AND created &lt;= endDateString to the query being built.

It is also possible to create an open interval by passing one of the arguments as null. Passing a non-null startDateString with a null endDateString will add the condition created &gt;= startDateString. Passing a non-null endDateString with a null startDateString will add the condition created &lt;= endDateString. Passing a null startDateString and null endDateString is illegal.

Parameters
startDateString the date that issues must be created on or after. Can be a date (e.g. "2008-10-23") or a period (e.g. "-3w"). May be null if endDateString is not null.
endDateString the date that issues must be created on or before. Can be a date (e.g. "2008-10-23") or a period (e.g. "-3w"). May be null if startDateString is not null.
Returns
  • a reference to the current builder.
Throws
IllegalStateException if it is not possible to add a JQL condition given the current state of the builder.
IllegalArgumentException if both startDateString and endDateString are null.

public JqlClauseBuilder createdBetween (Date startDate, Date endDate)

Add a condition to the query that finds the issues that where created between the passed dates. This essentially adds the query created &gt;= startDate AND created &lt;= endDate to the query being built.

It is also possible to create an open interval by passing one of the arguments as null. Passing a non-null startDate with a null endDate will add the condition created &gt;= startDate. Passing a non-null endDate with a null startDate will add the condition created &lt;= endDate. Passing a null startDate and null endDate is illegal.

Parameters
startDate the date that issues must be created on or after. May be null if endDate is not null.
endDate the date that issues must be created on or before. May be null if startDate is not null.
Returns
  • a reference to the current builder.
Throws
IllegalStateException if it is not possible to add a JQL condition given the current state of the builder.
IllegalArgumentException if both startDate and endDate are null.

public ConditionBuilder currentEstimate ()

Return a ConditionBuilder that can be used to build a JQL condition for the issue's current estimate.

Returns
  • a reference to a ConditionBuilder for current estimate.

public ConditionBuilder customField (Long id)

Return a ConditionBuilder that can be used to build a JQL condition for a custom field with the passed id.

Parameters
id the ID for the custom field. Cannot be null.
Returns
  • a reference to a ConditionBuilder for the passed ID.

public JqlClauseBuilder defaultAnd ()

Tell the builder to combine JQL conditions using the "AND" operator when none has been specified. Normally the caller must ensure that a call to either and() or or() is placed between calls to create JQL conditions. Calling this method on the builder tells it to automatically add a JQL "AND" between JQL conditions when no calls to either and or or have been made. This mode will remain active until one of defaultNone(), defaultOr() or clear() is called.

While in this mode it is still possible to explicitly call and or or to overide the default operator for the current condition.

For example builder.where().assigneeIsEmpty().or().defaultAnd().reporterIsCurrentUser().affectedVersion("10.5").defaultOr().issueType("bug").buildQuery() will build the JQL query "assignee is empty or reporter = currentUser() and affectedVersion = '10.5' or issuetype = bug".

Returns
  • a builder that can be used to further extends the current JQL expression.

public JqlClauseBuilder defaultNone ()

Tell the builder to stop injecting JQL "AND" or "OR" operators automatically between the generated JQL conditions. This essentially turns off the behaviour started by calling either defaultAnd() or defaultOr().

Returns
  • a builder that can be used to further extends the current JQL expression.

public JqlClauseBuilder defaultOr ()

Tell the builder to combine JQL conditions using the "OR" operator when none has been specified. Normally the caller must ensure that a call to either and() or or() is placed between calls to create JQL conditions. Calling this method on the builder tells it to automatically add a JQL "OR" between JQL conditions when no calls to either and or or have been made. This mode will remain active until one of defaultNone(), defaultAnd() or clear() is called.

While in this mode it is still possible to explicitly call and or or to overide the default operator for the current condition.

For example builder.where().assigneeIsEmpty().and().defaultOr().reporterIsCurrentUser().affectedVersion("10.5").defaultOr().issueType("bug").buildQuery() will build the JQL query "assignee is empty and reporter = currentUser() or affectedVersion = '10.5' or issuetype = bug".

Returns
  • a builder that can be used to further extends the current JQL expression.

public ConditionBuilder description ()

Return a ConditionBuilder that can be used to build a JQL condition for issue descriptions.

Returns
  • a reference to a ConditionBuilder for issue descriptions.

public JqlClauseBuilder description (String value)

Add a condition to the query that finds the issues that match the passed description. This essentially adds the condition description ~ "value" to the query being built.

NOTE: The description field performs apporximate text matching not exact text matching.

Parameters
value the value of the condition.
Returns
  • a reference to the current builder.
Throws
IllegalStateException if it is not possible to add a JQL condition given the current state of the builder.

public JqlClauseBuilder descriptionIsEmpty ()

Add a condition to the query that finds the issues that have no description. This essentially adds the condition description IS EMPTY to the query being built.

Returns
  • a reference to the current builder.
Throws
IllegalStateException if it is not possible to add a JQL condition given the current state of the builder.

public ConditionBuilder due ()

Return a ConditionBuilder that can be used to build a JQL condition for issue's due date.

Returns
  • a reference to a ConditionBuilder for due date.

public JqlClauseBuilder dueAfter (Date startDate)

Add a condition to the query that finds the issues that are due after the passed date. This essentially adds the query duedate &gt;= startDate to the query being built.

Parameters
startDate the date that issues must be due after. Cannot be null.
Returns
  • a reference to the current builder.
Throws
IllegalStateException if it is not possible to add a JQL condition given the current state of the builder.

public JqlClauseBuilder dueAfter (String startDate)

Add a condition to the query that finds the issues that are due after the passed date. This essentially adds the query duedate &gt;= startDate to the query being built.

Parameters
startDate the date that issues must be due after. Can be a date (e.g. "2008-10-23") or a period (e.g. "-3w"). Cannot be null.
Returns
  • a reference to the current builder.
Throws
IllegalStateException if it is not possible to add a JQL condition given the current state of the builder.

public JqlClauseBuilder dueBetween (String startDateString, String endDateString)

Add a condition to the query that finds the issues that where due between the passed dates. This essentially adds the query duedate &gt;= startDateString AND duedate &lt;= endDateString to the query being built.

It is also possible to create an open interval by passing one of the arguments as null. Passing a non-null startDateString with a null endDateString will add the condition duedate &gt;= startDateString. Passing a non-null endDateString with a null startDateString will add the condition duedate &lt;= endDateString. Passing a null startDateString and null endDateString is illegal.

Parameters
startDateString the date that issues must be due on or after. Can be a date (e.g. "2008-10-23") or a period (e.g. "-3w"). May be null if endDateString is not null.
endDateString the date that issues must be due on or before. Can be a date (e.g. "2008-10-23") or a period (e.g. "-3w"). May be null if startDateString is not null.
Returns
  • a reference to the current builder.
Throws
IllegalStateException if it is not possible to add a JQL condition given the current state of the builder.
IllegalArgumentException if both startDateString and endDateString are null.

public JqlClauseBuilder dueBetween (Date startDate, Date endDate)

Add a condition to the query that finds the issues that where due between the passed dates. This essentially adds the query duedate &gt;= startDate AND duedate &lt;= endDate to the query being built.

It is also possible to create an open interval by passing one of the arguments as null. Passing a non-null startDate with a null endDate will add the condition duedate &gt;= startDate. Passing a non-null endDate with a null startDate will add the condition duedate &lt;= endDate. Passing a null startDate and null endDate is illegal.

Parameters
startDate the date that issues must be due on or after. May be null if endDate is not null.
endDate the date that issues must be due on or before. May be null if startDate is not null.
Returns
  • a reference to the current builder.
Throws
IllegalStateException if it is not possible to add a JQL condition given the current state of the builder.
IllegalArgumentException if both startDate and endDate are null.

public JqlQueryBuilder endWhere ()

Call this to get a handle on the associated JqlQueryBuilder.

Returns
  • the associated JqlQueryBuilder. Null may be returned to indicate there is no associated builder.

public JqlClauseBuilder endsub ()

End the current sub JQL expression. This essentially adds a close bracket to the JQL query which will close the last open bracket.

Returns
  • a reference to the current builder.
Throws
IllegalStateException if there is not current sub expression to close, that is, there is no matching call to sub().
See Also

public JqlClauseBuilder environment (String value)

Add a condition to the query that finds the issues that match the passed environment. This essentially adds the condition environment ~ "value" to the query being built.

NOTE: The environment field performs apporximate text matching not exact text matching.

Parameters
value the value of the condition.
Returns
  • a reference to the current builder.
Throws
IllegalStateException if it is not possible to add a JQL condition given the current state of the builder.

public ConditionBuilder environment ()

Return a ConditionBuilder that can be used to build a JQL condition for issue environments.

Returns
  • a reference to a ConditionBuilder for issue environments.

public JqlClauseBuilder environmentIsEmpty ()

Add a condition to the query that finds the issues that have no environment. This essentially adds the condition environment IS EMPTY to the query being built.

Returns
  • a reference to the current builder.
Throws
IllegalStateException if it is not possible to add a JQL condition given the current state of the builder.

public ConditionBuilder field (String jqlName)

Return a ConditionBuilder that can be used to build a JQL condition for the passed name.

Parameters
jqlName the name of the JQL condition. Cannot be null.
Returns
  • a reference to a ConditionBuilder for the passed name.

public JqlClauseBuilder fixVersion (String... versions)

Add a condition to the query that finds the issues associated particular set of fix versions. This essentially adds the JQL condition fixVersion in (versions) to the query being built.

Parameters
versions the fix versions to search for. Each version can be specified either by its name (e.g. "1.2") or by its JIRA ID as a string (e.g. "10000"). Must not be null, empty or contain any null values.
Returns
  • a reference to the current builder.
Throws
IllegalStateException if it is not possible to add a JQL condition given the current state of the builder.

public JqlClauseBuilder fixVersion (Long... versions)

Add a condition to the query that finds the issues associated particular set of fix versions. This essentially adds the JQL condition fixVersion in (versions) to the query being built.

Parameters
versions the fix versions to search for. Must not be null, empty or contain any null values.
Returns
  • a reference to the current builder.
Throws
IllegalStateException if it is not possible to add a JQL condition given the current state of the builder.

public JqlClauseBuilder fixVersion (String version)

Add a condtion to the query that finds the issues associated with a particular fix version. This essentially adds the JQL condition fixVersion = "value" to the query being built.

Parameters
version the version to search for. Can be passed as its name (e.g. "1.2") or the string representation of its internal JIRA ID (e.g. "102020"). Must not be null.
Returns
  • a reference to the current builder.
Throws
IllegalStateException if it is not possible to add a JQL condition given the current state of the builder.

public JqlClauseBuilder fixVersion (Long version)

Add a condtion to the query that finds the issues associated with a particular fix version. This essentially adds the JQL condition fixVersion = version to the query being built.

Parameters
version the version to search for. Must not be null.
Returns
  • a reference to the current builder.
Throws
IllegalStateException if it is not possible to add a JQL condition given the current state of the builder.

public ConditionBuilder fixVersion ()

Return a ConditionBuilder that can be used to build a JQL condition for the fix version.

Returns
  • a reference to a ConditionBuilder for fix version.

public JqlClauseBuilder fixVersionIsEmpty ()

Adds adds a condition to the query to find issues with no assigned fix version. This essentially adds the JQL condition fixVersion IS EMPTY to the query being built.

Returns
  • a reference to the current builder.
Throws
IllegalStateException if it is not possible to add a JQL condition given the current state of the builder.

public JqlClauseBuilder issue (String... keys)

Add a condition to the query that will find all issues with the passed key. This essentially adds the JQL condition key IN (keys) to the query.

Parameters
keys the issues keys to search for. Cannot be null, empty or contain any nulls.
Returns
  • a reference to the current builder.
Throws
IllegalStateException if it is not possible to add a JQL condition given the current state of the builder.

public ConditionBuilder issue ()

Return a ConditionBuilder that can be used to build a JQL condition for the issue's id or key.

Returns
  • a reference to a ConditionBuilder for issue id or key.

public JqlClauseBuilder issueInHistory ()

Add a condition to the query that will find all issues currently within the user's history. This essentially adds the JQL condition key IN issueHistory() to the query.

Returns
  • a reference to the current builder.
Throws
IllegalStateException if it is not possible to add a JQL condition given the current state of the builder.

public JqlClauseBuilder issueInVotedIssues ()

Add a condition to the query that will find all issues the user has voted on. This essentially adds the JQL condition key IN votedIssues() to the query.

Returns
  • a reference to the current builder.
Throws
IllegalStateException if it is not possible to add a JQL condition given the current state of the builder.

public JqlClauseBuilder issueInWatchedIssues ()

Add a condition to the query that will find all issues currently watched by the user. This essentially adds the JQL condition key IN watchedIssues() to the query.

Returns
  • a reference to the current builder.
Throws
IllegalStateException if it is not possible to add a JQL condition given the current state of the builder.

public ConditionBuilder issueParent ()

Return a ConditionBuilder that can be used to build a JQL condition for the issue's parent.

Returns
  • a reference to a ConditionBuilder for issue parent.

public JqlClauseBuilder issueParent (String... keys)

Add a condition to the query that will find all issues that have the passed issues as parents. This essentially adds the condition parent IN (keys) to the query.

Parameters
keys the issues keys to search for. Cannot be null, empty or contain any nulls.
Returns
  • a reference to the current builder.
Throws
IllegalStateException if it is not possible to add a JQL condition given the current state of the builder.

public JqlClauseBuilder issueType (String... types)

Add a condition to the query that finds the issues of a particular type. This essentially adds the JQL condition issuetype in (types) to the query being built.

Parameters
types the JIRA issue types to search for. Each type can be specified either by its name (e.g. "Bug") or by its JIRA ID as a string (e.g. "10000"). Must not be null, empty or contain any null values.
Returns
  • a reference to the current builder.
Throws
IllegalStateException if it is not possible to add a JQL condition given the current state of the builder.

public ConditionBuilder issueType ()

Return a ConditionBuilder that can be used to build a JQL condition for issue types.

Returns
  • a reference to a ConditionBuilder for issue types.

public JqlClauseBuilder issueTypeIsStandard ()

Add a condition to the query that finds the "standard" issue types. Standard issues types are those that are not sub-tasks. This essentially adds the JQL condition issuetype in standardIssueTypes() to the query being built.

Returns
  • a reference to the current builder.
Throws
IllegalStateException if it is not possible to add a JQL condition given the current state of the builder.

public JqlClauseBuilder issueTypeIsSubtask ()

Add a condition to the query that finds the "sub-task" issue types. This essentially adds the JQL condition issuetype in subTaskIssueTypes() to the query being built.

Returns
  • a reference to the current builder.
Throws
IllegalStateException if it is not possible to add a JQL condition given the current state of the builder.

public ConditionBuilder labels ()

Return a ConditionBuilder that can be used to build a JQL condition for the issue's labels.

Returns
  • a reference to a ConditionBuilder for labels.

public JqlClauseBuilder labels (String... labels)

Add a condition to the query to find all issues with particular labels. This essentially adds the JQL condition labels in (labels) to the query.

Parameters
labels the labels to search for. Must not be null, contain nulls or be empty.
Returns
  • a reference to the current builder.
Throws
IllegalStateException if it is not possible to add a JQL condition given the current state of the builder.

public JqlClauseBuilder labelsIsEmpty ()

Add a condition to the query to find all issues that have no labels. This essentially adds the JQL condition labels IS EMTPY to the query.

Returns
  • a reference to the current builder.
Throws
IllegalStateException if it is not possible to add a JQL condition given the current state of the builder.

public ConditionBuilder lastViewed ()

Return a ConditionBuilder that can be used to build a JQL condition for issue's last viewed date.

Returns
  • a reference to a ConditionBuilder for last viewed date.

public JqlClauseBuilder lastViewedAfter (String startDate)

Add a condition to the query that finds the issues that where viewed after the passed date (if issue is stored in history kept). This essentially adds the query lastViewed &gt;= startDate to the query being built.

Parameters
startDate the date that issues must be viewed after. Can be a date (e.g. "2008-10-23") or a period (e.g. "-3w"). Cannot be null.
Returns
  • a reference to the current builder.
Throws
IllegalStateException if it is not possible to add a JQL condition given the current state of the builder.

public JqlClauseBuilder lastViewedAfter (Date startDate)

Add a condition to the query that finds the issues that where last viewed after the passed date (if issue is stored in history kept). This essentially adds the query lastViewed &gt;= startDate to the query being built.

Parameters
startDate the date that issues must be viewed after. Cannot be null.
Returns
  • a reference to the current builder.
Throws
IllegalStateException if it is not possible to add a JQL condition given the current state of the builder.

public JqlClauseBuilder lastViewedBetween (String startDateString, String endDateString)

Add a condition to the query that finds the issues that where last viewed between the passed dates. This essentially adds the query lastViewed &gt;= startDateString AND lastViewed &lt;= endDateString to the query being built.

It is also possible to create an open interval by passing one of the arguments as null. Passing a non-null startDateString with a null endDateString will add the condition lastViewed &gt;= startDateString. Passing a non-null endDateString with a null startDateString will add the condition lastViewed &lt;= endDateString. Passing a null startDateString and null endDateString is illegal.

Parameters
startDateString the date that issues must be last viewed on or after. Can be a date (e.g. "2008-10-23") or a period (e.g. "-3w"). May be null if endDateString is not null.
endDateString the date that issues must be last viewed on or before. Can be a date (e.g. "2008-10-23") or a period (e.g. "-3w"). May be null if startDateString is not null.
Returns
  • a reference to the current builder.
Throws
IllegalStateException if it is not possible to add a JQL condition given the current state of the builder.
IllegalArgumentException if both startDateString and endDateString are null.

public JqlClauseBuilder lastViewedBetween (Date startDate, Date endDate)

Add a condition to the query that finds the issues that where viewed between the passed dates. This essentially adds the query lastViewed &gt;= startDate AND lastViewed &lt;= endDate to the query being built.

It is also possible to create an open interval by passing one of the arguments as null. Passing a non-null startDate with a null endDate will add the condition lastViewed &gt;= startDate. Passing a non-null endDate with a null startDate will add the condition lastViewed &lt;= endDate. Passing a null startDate and null endDate is illegal. This will only return issues that are stored in the user's history ~ 50 issues.

Parameters
startDate the date that issues must be viewed on or after. May be null if endDate is not null.
endDate the date that issues must be viewed on or before. May be null if startDate is not null.
Returns
  • a reference to the current builder.
Throws
IllegalStateException if it is not possible to add a JQL condition given the current state of the builder.
IllegalArgumentException if both startDate and endDate are null.

public JqlClauseBuilder level (String... levels)

Add a condition to the query that will find all issues with the passed security levels. This essentially adds the condition level IN (levels) to the query.

Parameters
levels the security levels to search for. Cannot be null, empty or contain nulls.
Returns
  • a reference to the current builder.
Throws
IllegalStateException if it is not possible to add a JQL condition given the current state of the builder.

public ConditionBuilder level ()

Return a ConditionBuilder that can be used to build a JQL condition for the issue's security level.

Returns
  • a reference to a ConditionBuilder for issue level.

public JqlClauseBuilder not ()

Add the JQL "NOT" operator to the JQL expression currently being built. The builder takes into account operator precendence when generating the JQL expression, and as such, the caller may need to group JQL conditions using the sub() and endsub() calls. For example, builder.not().affectedVersion("11").and().effectedVersion("12") produces the JQL NOT (affectedVersion = "11") and affectedVersion = "12" as the and() "AND" operator} has a lower precedence than "NOT". On the other hand, builder.not().sub().affectedVersion("11").and().effectedVersion("12").endsub() produces the JQL NOT(affectedVersion = "11" andaffectedVersion = "12").

Returns
  • a reference to the current builder.
Throws
IllegalStateException if it is not possible to add the NOT operator given the current state of the builder.

public JqlClauseBuilder or ()

Add the JQL "OR" operator to the JQL expression currently being built. The builder takes into account operator precendence when generating the JQL expression, and as such, the caller may need to group JQL conditions using the sub() and endsub() calls. For example, builder.issueType("bug").and().affectedVersion("11").or().affectedVersion("12") produces the JQL (issueType = "bug" andaffectedVersion = "11") or affectedVersion = "12" as the "AND" operator has a higher precedence than "OR". On the other hand, builder.issueType("bug").and().sub().affectedVersion("11").or().affectedVersion("12").endsub() produces the JQL issueType = "bug" and (affectedVersion = "11" or affectedVersion = "12").

Returns
  • a reference to the current builder.
Throws
IllegalStateException if it is not possible to add the OR operator given the current state of the builder.

public ConditionBuilder originalEstimate ()

Return a ConditionBuilder that can be used to build a JQL condition for the issue's original estimate.

Returns
  • a reference to a ConditionBuilder for original estimate.

public ConditionBuilder priority ()

Return a ConditionBuilder that can be used to build a JQL condition for the priority.

Returns
  • a reference to a ConditionBuilder for priority.

public JqlClauseBuilder priority (String... priorities)

Add a condition to the query that finds the issues associated particular set of priorities. This essentially adds the JQL condition priority in (priorities) to the query being built.

Parameters
priorities the JIRA priorities to search for. Each priority can be specified either by its name (e.g. "Major") or by its JIRA ID as a string (e.g. "10000"). Must not be null, empty or contain any null values.
Returns
  • a reference to the current builder.
Throws
IllegalStateException if it is not possible to add a JQL condition given the current state of the builder.

public JqlClauseBuilder project (Long... pids)

Add a condition to the query that finds the issues within a particular project. This essentially adds the JQL condition project in (pids) to the query being built.

Parameters
pids the JIRA id's of the projects to search for. Cannot be null, empty or contain null values.
Returns
  • a reference to the current builder.
Throws
IllegalStateException if it is not possible to add a JQL condition given the current state of the builder.

public ConditionBuilder project ()

Return a ConditionBuilder that can be used to build a JQL condition for an issue's project.

Returns
  • a reference to a ConditionBuilder for projects

public JqlClauseBuilder project (String... projects)

Add a condition to the query that finds the issues within a particular project. This essentially adds the JQL condition project in (projects) to the query being built.

Parameters
projects the JIRA projects to search for. Each project can be specified by its name (e.g. "JIRA"), its key (e.g. "JRA") or by its JIRA ID as a string (e.g. "10000"). Must not be null, empty or contain any null values.
Returns
  • a reference to the current builder.
Throws
IllegalStateException if it is not possible to add a JQL condition given the current state of the builder.

public ConditionBuilder reporter ()

Return a ConditionBuilder that can be used to build a JQL condition for the issue's reporter.

Returns
  • a reference to a ConditionBuilder for reporter.

public JqlClauseBuilder reporterInGroup (String groupName)

Add a condition to the query that finds all issues that were reported by users in a particular group. This essentially adds the condition reporter in memboersOf("groupName") to the query being built.

Parameters
groupName the group for the condition. Cannot be null.
Returns
  • a reference to the current builder.
Throws
IllegalStateException if it is not possible to add a JQL condition given the current state of the builder.

public JqlClauseBuilder reporterIsCurrentUser ()

Add a condition to the query that finds all issues that were reported by the current user. This essentially adds the condition reporter = currentUser() to the query being built.

Returns
  • a reference to the current builder.
Throws
IllegalStateException if it is not possible to add a JQL condition given the current state of the builder.

public JqlClauseBuilder reporterIsEmpty ()

Add a condition to the query to find issues without a reporter. This essentially adds the condition reporter IS EMPTY to the query being built.

Returns
  • a reference to the current builder.
Throws
IllegalStateException if it is not possible to add a JQL condition given the current state of the builder.

public JqlClauseBuilder reporterUser (String userName)

Add a condition to the query that finds issues that where reported by the passed user. This essentially adds the condition reporter = userName to the query being built.

Parameters
userName the username to search for. Cannot be null.
Returns
  • a reference to the current builder.
Throws
IllegalStateException if it is not possible to add a JQL condition given the current state of the builder.

public ConditionBuilder resolution ()

Return a ConditionBuilder that can be used to build a JQL condition for resolution.

Returns
  • a reference to a ConditionBuilder for resolution.

public JqlClauseBuilder resolution (String... resolutions)

Add a condition to the query that finds the issues associated particular set of resolutions. This essentially adds the JQL condition resolution in (resultions) to the query being built.

Parameters
resolutions the JIRA resolutions to search for. Each resolution can be specified either by its name (e.g. "Resolved") or by its JIRA ID as a string (e.g. "10000"). Must not be null, empty or contain any null values.
Returns
  • a reference to the current builder.
Throws
IllegalStateException if it is not possible to add a JQL condition given the current state of the builder.

public ConditionBuilder resolutionDate ()

Return a ConditionBuilder that can be used to build a JQL condition for issue's resolution date.

Returns
  • a reference to a ConditionBuilder for resolution date.

public JqlClauseBuilder resolutionDateAfter (Date startDate)

Add a condition to the query that finds the issues that were reolved after the passed date. This essentially adds the query resolutiondate &gt;= startDate to the query being built.

Parameters
startDate the date that issues must be resolved after. Cannot be null.
Returns
  • a reference to the current builder.
Throws
IllegalStateException if it is not possible to add a JQL condition given the current state of the builder.

public JqlClauseBuilder resolutionDateAfter (String startDate)

Add a condition to the query that finds the issues that were resolved after the passed date. This essentially adds the query resolutiondate &gt;= startDate to the query being built.

Parameters
startDate the date that issues must be resolved after. Can be a date (e.g. "2008-10-23") or a period (e.g. "-3w"). Cannot be null.
Returns
  • a reference to the current builder.
Throws
IllegalStateException if it is not possible to add a JQL condition given the current state of the builder.

public JqlClauseBuilder resolutionDateBetween (Date startDate, Date endDate)

Add a condition to the query that finds the issues that where resolved between the passed dates. This essentially adds the query resolutiondate &gt;= startDate AND resolutiondate &lt;= endDate to the query being built.

It is also possible to create an open interval by passing one of the arguments as null. Passing a non-null startDate with a null endDate will add the condition resolutiondate &gt;= startDate. Passing a non-null endDate with a null startDate will add the condition resolutiondate &lt;= endDate. Passing a null startDate and null endDate is illegal.

Parameters
startDate the date that issues must be resolved on or after. May be null if endDate is not null.
endDate the date that issues must be resolved on or before. May be null if startDate is not null.
Returns
  • a reference to the current builder.
Throws
IllegalStateException if it is not possible to add a JQL condition given the current state of the builder.
IllegalArgumentException if both startDate and endDate are null.

public JqlClauseBuilder resolutionDateBetween (String startDateString, String endDateString)

Add a condition to the query that finds the issues that where resolved between the passed dates. This essentially adds the query resolutiondate &gt;= startDateString AND resolutiondate &lt;= endDateString to the query being built.

It is also possible to create an open interval by passing one of the arguments as null. Passing a non-null startDateString with a null endDateString will add the condition resolutiondate &gt;= startDateString. Passing a non-null endDateString with a null startDateString will add the condition resolutiondate &lt;= endDateString. Passing a null startDateString and null endDateString is illegal.

Parameters
startDateString the date that issues must be resolved on or after. Can be a date (e.g. "2008-10-23") or a period (e.g. "-3w"). May be null if endDateString is not null.
endDateString the date that issues must be resolved on or before. Can be a date (e.g. "2008-10-23") or a period (e.g. "-3w"). May be null if startDateString is not null.
Returns
  • a reference to the current builder.
Throws
IllegalStateException if it is not possible to add a JQL condition given the current state of the builder.
IllegalArgumentException if both startDateString and endDateString are null.

public ConditionBuilder savedFilter ()

Return a ConditionBuilder that can be used to add saved filters as conditions to the query.

Returns
  • a reference to a ConditionBuilder for saved filters.

public JqlClauseBuilder savedFilter (String... filters)

Add a condition to the query that will inclue the results from the passed filters in the search. This essentially adds the condition filter IN (filters) to the condition.

Parameters
filters the filters to include in the search. They can be specified by the name (e.g. "JIRA Unresolved") or by their JIRA id (e.g. "10000"). Cannot be null, empty or contain any nulls.
Returns
  • a reference to the current builder.
Throws
IllegalStateException if it is not possible to add a JQL condition given the current state of the builder.

public ConditionBuilder status ()

Return a ConditionBuilder that can be used to build a JQL condition for status.

Returns
  • a reference to a ConditionBuilder for status.

public JqlClauseBuilder status (String... statuses)

Add a condition to the query that finds the issues associated particular set of statuses. This essentially adds the JQL condition status in (statuses) to the query being built.

Parameters
statuses the JIRA statuses to search for. Each status can be specified either by its name (e.g. "Won't Fix") or by its JIRA ID as a string (e.g. "10000"). Must not be null, empty or contain any null values.
Returns
  • a reference to the current builder.
Throws
IllegalStateException if it is not possible to add a JQL condition given the current state of the builder.

public JqlClauseBuilder sub ()

Create a new sub expression in the current JQL. This essentialy opens a bracket in the JQL query such that all the JQL expressions from now until the next matching close bracket are grouped together. This can be used to override JQL's precedence rules. For example, builder.sub().affectedVersion("12").or().affectedVersion("11").endsub().and().issueType("bug") will produce the JQL query (affectedVersion = "12" oraffectedVersion = "12") and type = "bug".

Returns
  • a reference to the current builder.
Throws
IllegalStateException if it is not possible to create a sub JQL expression given the current state of the builder.

public ConditionBuilder summary ()

Return a ConditionBuilder that can be used to build a JQL condition for issue summaries.

Returns
  • a reference to a ConditionBuilder for issue summaries.

public JqlClauseBuilder summary (String value)

Add a condition to the query that finds the issues match the passed summary. This essentially adds the condition summary ~ "value" to the query being built.

NOTE: The summary field performs apporximate text matching not exact text matching.

Parameters
value the value of the condition.
Returns
  • a reference to the current builder.
Throws
IllegalStateException if it is not possible to add a JQL condition given the current state of the builder.

public ConditionBuilder timeSpent ()

Return a ConditionBuilder that can be used to build a JQL condition for the issue's timespent field.

Returns
  • a reference to a ConditionBuilder for timespent.

public JqlClauseBuilder unresolved ()

Add a condition to query that finds the issues that have not been resolved. This essentially adds the JQL condition resolution IS EMPTY to the query being built.

Returns
  • a reference to the current builder.
Throws
IllegalStateException if it is not possible to add a JQL condition given the current state of the builder.

public ConditionBuilder updated ()

Return a ConditionBuilder that can be used to build a JQL condition for issue's updated date.

Returns
  • a reference to a ConditionBuilder for updated date.

public JqlClauseBuilder updatedAfter (Date startDate)

Add a condition to the query that finds the issues that were updated after the passed date. This essentially adds the query updated &gt;= startDate to the query being built.

Parameters
startDate the date that issues must be updated after. Cannot be null.
Returns
  • a reference to the current builder.
Throws
IllegalStateException if it is not possible to add a JQL condition given the current state of the builder.

public JqlClauseBuilder updatedAfter (String startDate)

Add a condition to the query that finds the issues that were updated after the passed date. This essentially adds the query updated &gt;= startDate to the query being built.

Parameters
startDate the date that issues must be updated after. Can be a date (e.g. "2008-10-23") or a period (e.g. "-3w"). Cannot be null.
Returns
  • a reference to the current builder.
Throws
IllegalStateException if it is not possible to add a JQL condition given the current state of the builder.

public JqlClauseBuilder updatedBetween (String startDateString, String endDateString)

Add a condition to the query that finds the issues that where updated between the passed dates. This essentially adds the query updated &gt;= startDateString AND updated &lt;= endDateString to the query being built.

It is also possible to create an open interval by passing one of the arguments as null. Passing a non-null startDateString with a null endDateString will add the condition updated &gt;= startDateString. Passing a non-null endDateString with a null startDateString will add the condition updated &lt;= endDateString. Passing a null startDateString and null endDateString is illegal.

Parameters
startDateString the date that issues must be updated on or after. Can be a date (e.g. "2008-10-23") or a period (e.g. "-3w"). May be null if endDateString is not null.
endDateString the date that issues must be updated on or before. Can be a date (e.g. "2008-10-23") or a period (e.g. "-3w"). May be null if startDateString is not null.
Returns
  • a reference to the current builder.
Throws
IllegalStateException if it is not possible to add a JQL condition given the current state of the builder.
IllegalArgumentException if both startDateString and endDateString are null.

public JqlClauseBuilder updatedBetween (Date startDate, Date endDate)

Add a condition to the query that finds the issues that where updated between the passed dates. This essentially adds the query updated &gt;= startDate AND updated &lt;= endDate to the query being built.

It is also possible to create an open interval by passing one of the arguments as null. Passing a non-null startDate with a null endDate will add the condition updated &gt;= startDate. Passing a non-null endDate with a null startDate will add the condition updated &lt;= endDate. Passing a null startDate and null endDate is illegal.

Parameters
startDate the date that issues must be updated on or after. May be null if endDate is not null.
endDate the date that issues must be updated on or before. May be null if startDate is not null.
Returns
  • a reference to the current builder.
Throws
IllegalStateException if it is not possible to add a JQL condition given the current state of the builder.
IllegalArgumentException if both startDate and endDate are null.

public ConditionBuilder voter ()

Return a ConditionBuilder that can be used to build a JQL condition for the number of votes on an issue.

Returns
  • a reference to a ConditionBuilder for votes.

public JqlClauseBuilder voterInGroup (String groupName)

Add a condition to the query that finds all issues that were voted for by users in a particular group. This essentially adds the condition voter in membersOf("groupName") to the query being built.

Parameters
groupName the group for the condition. Cannot be null.
Returns
  • a reference to the current builder.
Throws
IllegalStateException if it is not possible to add a JQL condition given the current state of the builder.

public JqlClauseBuilder voterIsCurrentUser ()

Add a condition to the query that finds all issues that were voted for by the current user. This essentially adds the condition voter = currentUser() to the query being built.

Returns
  • a reference to the current builder.
Throws
IllegalStateException if it is not possible to add a JQL condition given the current state of the builder.

public JqlClauseBuilder voterIsEmpty ()

Add a condition to the query to find issues without any votes. This essentially adds the condition voter IS EMPTY to the query being built.

Returns
  • a reference to the current builder.
Throws
IllegalStateException if it is not possible to add a JQL condition given the current state of the builder.

public JqlClauseBuilder voterUser (String userName)

Add a condition to the query that finds issues that are voted for by the passed user. This essentially adds the condition voter = userName to the query being built.

Parameters
userName the username to search for. Cannot be null.
Returns
  • a reference to the current builder.
Throws
IllegalStateException if it is not possible to add a JQL condition given the current state of the builder.

public ConditionBuilder votes ()

Return a ConditionBuilder that can be used to build a JQL condition for the number of votes on an issue.

Returns
  • a reference to a ConditionBuilder for votes.

public ConditionBuilder watcher ()

Return a ConditionBuilder that can be used to build a JQL condition for the number of watches on an issue.

Returns
  • a reference to a ConditionBuilder for watcher.

public JqlClauseBuilder watcherInGroup (String groupName)

Add a condition to the query that finds all issues that were watched by users in a particular group. This essentially adds the condition watcher in membersOf("groupName") to the query being built.

Parameters
groupName the group for the condition. Cannot be null.
Returns
  • a reference to the current builder.
Throws
IllegalStateException if it is not possible to add a JQL condition given the current state of the builder.

public JqlClauseBuilder watcherIsCurrentUser ()

Add a condition to the query that finds all issues that were watched by the current user. This essentially adds the condition watcher = currentUser() to the query being built.

Returns
  • a reference to the current builder.
Throws
IllegalStateException if it is not possible to add a JQL condition given the current state of the builder.

public JqlClauseBuilder watcherIsEmpty ()

Add a condition to the query to find issues without any watchers. This essentially adds the condition watcher IS EMPTY to the query being built.

Returns
  • a reference to the current builder.
Throws
IllegalStateException if it is not possible to add a JQL condition given the current state of the builder.

public JqlClauseBuilder watcherUser (String userName)

Add a condition to the query that finds issues that are watched by the passed user. This essentially adds the condition watcher = userName to the query being built.

Parameters
userName the username to search for. Cannot be null.
Returns
  • a reference to the current builder.
Throws
IllegalStateException if it is not possible to add a JQL condition given the current state of the builder.

public ConditionBuilder watches ()

Return a ConditionBuilder that can be used to build a JQL condition for the number of watches on an issue.

Returns
  • a reference to a ConditionBuilder for votes.

public ConditionBuilder workRatio ()

Return a ConditionBuilder that can be used to build a JQL condition for the issue's work ratio field.

Returns
  • a reference to a ConditionBuilder for work ratio.