Interface JqlClauseBuilder
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 provides methods to build terminal clauses specific to system fields (e.g. reporter()
)
and shortcuts for common terminal clauses (e.g. unresolved()
which produces the terminal clause resolution = Unresolved
).
But also allows the programmer to define their 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 pass nulls, empty collections, empty arrays, collections that contain nulls, or arrays
that contain nulls to the methods on the interface. Any exception to these argument conditions is 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 Ids 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.
- Since:
- v4.0
-
Method Summary
Modifier and TypeMethodDescriptionAdds the passed JQL condition to the query being built.addCondition
(String clauseName) Returns aConditionBuilder
that can be used to build a JQL condition for the passed JQL name.addCondition
(String clauseName, Operand operand) Adds the JQL conditionclauseName = operand
to the query being built.addCondition
(String clauseName, Operand... operands) Adds the JQL conditionclauseName in (operands)
to the query being built.addCondition
(String clauseName, Operator operator, Operand operand) Adds the JQL conditionclauseName operator operand
to the query being built.addCondition
(String clauseName, Operator operator, Operand... operands) Adds the JQL conditionclauseName operator (operands)
to the query being built.addCondition
(String clauseName, Operator operator, Collection<? extends Operand> operands) Adds the JQL conditionclauseName operator (operands)
to the query being built.addCondition
(String clauseName, Collection<? extends Operand> operands) Add the JQL conditionclauseName in (operands)
to the query being built.addDateCondition
(String clauseName, Operator operator, Collection<Date> dates) Adds the JQL conditionclauseName operator (clauseValues)
to the query being built.addDateCondition
(String clauseName, Operator operator, Date date) Adds the JQL conditionclauseName operator date
to the query being built.addDateCondition
(String clauseName, Operator operator, Date... dates) Adds the JQL conditionclauseName operator (clauseValues)
to the query being built.addDateCondition
(String clauseName, Collection<Date> dates) Adds the JQL conditionclauseName in (dates)
to the query being built.addDateCondition
(String clauseName, Date... dates) Adds the JQL conditionclauseName in (dates)
to the query being built.addDateRangeCondition
(String clauseName, Date startDate, Date endDate) Adds a condition range condition to the current query for the passed dates.addEmptyCondition
(String clauseName) Adds an "IS EMPTY" condition to the current query for the passed JQL clause.addFieldReferenceCondition
(JqlFieldReference ref, Collection<String> clauseValues) Adds the JQL conditionclauseName in (clauseValues)
in form of field reference to the query being built.addFunctionCondition
(String clauseName, Operator operator, String functionName) Adds the JQL conditionclauseName operator functionName()
to the query being built.addFunctionCondition
(String clauseName, Operator operator, String functionName, String... args) Adds the JQL conditionclauseName operator functionName(arg1, arg2, arg3, ..., argN)
to the query being built.addFunctionCondition
(String clauseName, Operator operator, String functionName, Collection<String> args) Adds the JQL conditionclauseName operator functionName(arg1, arg2, arg3, ..., argN)
to the query being built.addFunctionCondition
(String clauseName, String functionName) Adds the JQL conditionclauseName = functionName()
to the query being built.addFunctionCondition
(String clauseName, String functionName, String... args) Adds the JQL conditionclauseName = functionName(arg1, arg2, arg3, ..., argN)
to the query being built.addFunctionCondition
(String clauseName, String functionName, Collection<String> args) Adds the JQL conditionclauseName = functionName(arg1, arg2, arg3, ..., argN)
to the query being built.addNumberCondition
(String clauseName, Operator operator, Long clauseValue) Adds the JQL conditionclauseName operator clauseValue
to the query being built.addNumberCondition
(String clauseName, Operator operator, Long... clauseValues) Adds the JQL conditionclauseName operator (clauseValues)
to the query being built.addNumberCondition
(String clauseName, Operator operator, Collection<Long> clauseValues) Add the JQL conditionclauseName operator (clauseValues)
to the query being built.addNumberCondition
(String clauseName, Long clauseValue) Adds the JQL conditionclauseName = clauseValue
to the query being built.addNumberCondition
(String clauseName, Long... clauseValues) Adds the JQL conditionclauseName in (clauseValues)
to the query being built.addNumberCondition
(String clauseName, Collection<Long> clauseValues) Adds the JQL conditionclauseName in (clauseValues)
to the query being built.addNumberRangeCondition
(String clauseName, Long start, Long end) Adds a condition range condition to the current query for the passed values.addRangeCondition
(String clauseName, Operand start, Operand end) Adds a condition range condition to the current query for the passed values.addStringCondition
(String clauseName, Operator operator, String clauseValue) Adds the JQL conditionclauseName operator "clauseValue"
to the query being built.addStringCondition
(String clauseName, Operator operator, String... clauseValues) Adds the JQL conditionclauseName operator (clauseValues)
to the query being built.addStringCondition
(String clauseName, Operator operator, Collection<String> clauseValues) Adds the JQL conditionclauseName operator (clauseValues)
to the query being built.addStringCondition
(String clauseName, String clauseValue) Adds the JQL conditionclauseName = "clauseValue"
to the query being built.addStringCondition
(String clauseName, String... clauseValues) Adds the JQL conditionclauseName in (clauseValues)
to the query being built.addStringCondition
(String clauseName, Collection<String> clauseValues) Adds the JQL conditionclauseName in (clauseValues)
to the query being built.addStringRangeCondition
(String clauseName, String start, String end) Adds a condition range condition to the current query for the passed values.Returns aConditionBuilder
that can be used to build a JQL condition for the affected version.affectedVersion
(String version) Adds a condition to the query that finds the issues associated with a particular affected version.affectedVersion
(String... versions) Adds a condition to the query that finds the issues associated with a particular set of affected versions.Adds a condition to the query to find issues with no assigned affected version.and()
Adds the JQL "AND" operator to the JQL expression currently being built.assignee()
Returns aConditionBuilder
that can be used to build a JQL condition for the issue's assignee.assigneeInGroup
(String groupName) Adds a condition to the query that finds all issues that are assigned to users in a particular group.Adds a condition to the query that finds all issues that are assigned to the current user.Adds a condition to the query to find all unassigned issues.assigneeUser
(String userName) Adds a condition to the query that finds issues that are assigned to the passed user.attachmentsExists
(boolean hasAttachment) Adds a condition to the query that finds issues which contain/do not contain attachments.Creates the JQL clause the builder has currently constructed.Builds aQuery
using the current builder.category()
Returns aConditionBuilder
that can be used to build a JQL condition for issue's in a particular project category.Adds a condition to the query that finds the issues from projects within a list of project categories.clear()
Reset the builder to its empty state.comment()
Returns aConditionBuilder
that can be used to build a JQL condition for issue comments.Adds a condition to the query that finds the issues that match the passed comment.Returns aConditionBuilder
that can be used to build a JQL condition for the issue's component.Adds a condition to the query to find all issues with particular components.Add a condition to the query to find all issues with particular components.Adds a condition to the query to find all issues that have not component assigned.created()
Returns aConditionBuilder
that can be used to build a JQL condition for issue's creation date.createdAfter
(String startDate) Adds a condition to the query that finds the issues that were created after the passed date.createdAfter
(Date startDate) Adds a condition to the query that finds the issues that were created after the passed date.createdBetween
(String startDateString, String endDateString) Adds a condition to the query that finds the issues that where created between the passed dates.createdBetween
(Date startDate, Date endDate) Adds a condition to the query that finds the issues that were created between the passed dates.Returns aConditionBuilder
that can be used to build a JQL condition for the issue's current estimate.customField
(Long id) Returns aConditionBuilder
that can be used to build a JQL condition for a custom field with the passed id.Combines JQL conditions using the "AND" operator when none has been specified.Stops injecting JQL "AND" or "OR" operators automatically between the generated JQL conditions.Combines JQL conditions using the "OR" operator when none has been specified.Returns aConditionBuilder
that can be used to build a JQL condition for issue descriptions.description
(String value) Adds a condition to the query that finds the issues that match the passed description.Adds a condition to the query that finds the issues that have no description.due()
Returns aConditionBuilder
that can be used to build a JQL condition for issue's due date.Adds a condition to the query that finds the issues that are due after the passed date.Adds a condition to the query that finds the issues that are due after the passed date.dueBetween
(String startDateString, String endDateString) Adds a condition to the query that finds the issues that were due between the passed dates.dueBetween
(Date startDate, Date endDate) Adds a condition to the query that finds the issues that were due between the passed dates.endsub()
Ends the current sub JQL expression.endWhere()
Gets a handle on the associatedJqlQueryBuilder
.Returns aConditionBuilder
that can be used to build a JQL condition for issue environments.environment
(String value) Adds a condition to the query that finds the issues that match the passed environment.Adds a condition to the query that finds the issues that have no environment.Returns aConditionBuilder
that can be used to build a JQL condition for the passed name.Returns aConditionBuilder
that can be used to build a JQL condition for the fix version.fixVersion
(Long version) Adds a condition to the query that finds the issues associated with a particular fix version.fixVersion
(Long... versions) Adds a condition to the query that finds the issues associated with a particular set of fix versions.fixVersion
(String version) Adds a condition to the query that finds the issues associated with a particular fix version.fixVersion
(String... versions) Adds a condition to the query that finds the issues associated with a particular set of fix versions.Adds a condition to the query to find issues with no assigned fix version.issue()
Returns aConditionBuilder
that can be used to build a JQL condition for the issue's id or key.Adds a condition to the query that will find all issues with the passed key.Adds a condition to the query that will find all issues currently within the user's history.Adds a condition to the query that will find all issues the user has voted on.Adds a condition to the query that will find all issues currently watched by the user.Returns aConditionBuilder
that can be used to build a JQL condition for the issue's parent.issueParent
(String... keys) Adds a condition to the query that will find all issues that have the passed issues as parents.Returns aConditionBuilder
that can be used to build a JQL condition for issue types.Adds a condition to the query that finds the issues of a particular type.Adds a condition to the query that finds the "standard" issue types.Adds a condition to the query that finds the "sub-task" issue types.labels()
Returns aConditionBuilder
that can be used to build a JQL condition for the issue's labels.Adds a condition to the query to find all issues with particular labels.Adds a condition to the query to find all issues that have no labels.Returns aConditionBuilder
that can be used to build a JQL condition for issue's last viewed date.lastViewedAfter
(String startDate) Adds a condition to the query that finds the issues that were viewed after the passed date (if issue is stored in history).lastViewedAfter
(Date startDate) Adds a condition to the query that finds the issues that were last viewed after the passed date (if issue is stored in history).lastViewedBetween
(String startDateString, String endDateString) Adds a condition to the query that finds the issues that were last viewed between the passed dates.lastViewedBetween
(Date startDate, Date endDate) Adds a condition to the query that finds the issues that were viewed between the passed dates.level()
Returns aConditionBuilder
that can be used to build a JQL condition for the issue's security level.Adds a condition to the query that will find all issues with the passed security levels.not()
Adds the JQL "NOT" operator to the JQL expression currently being built.or()
Adds the JQL "OR" operator to the JQL expression currently being built.Returns aConditionBuilder
that can be used to build a JQL condition for the issue's original estimate.priority()
Returns aConditionBuilder
that can be used to build a JQL condition for the priority.Adds a condition to the query that finds the issues associated with a particular set of priorities.project()
Returns aConditionBuilder
that can be used to build a JQL condition for an issue's project.Adds a condition to the query that finds the issues within a particular project.Adds a condition to the query that finds the issues within a particular project.reporter()
Returns aConditionBuilder
that can be used to build a JQL condition for the issue's reporter.reporterInGroup
(String groupName) Adds a condition to the query that finds all issues that were reported by users in a particular group.Adds a condition to the query that finds all issues that were reported by the current user.Adds a condition to the query to find issues without a reporter.reporterUser
(String userName) Adds a condition to the query that finds issues that where reported by the passed user.Returns aConditionBuilder
that can be used to build a JQL condition for resolution.resolution
(String... resolutions) Adds a condition to the query that finds the issues associated with a particular set of resolutions.Returns aConditionBuilder
that can be used to build a JQL condition for issue's resolution date.resolutionDateAfter
(String startDate) Adds a condition to the query that finds the issues that were resolved after the passed date.resolutionDateAfter
(Date startDate) Adds a condition to the query that finds the issues that were resolved after the passed date.resolutionDateBetween
(String startDateString, String endDateString) Adds a condition to the query that finds the issues that were resolved between the passed dates.resolutionDateBetween
(Date startDate, Date endDate) Adds a condition to the query that finds the issues that were resolved between the passed dates.Returns aConditionBuilder
that can be used to add saved filters as conditions to the query.savedFilter
(String... filters) Adds a condition to the query that will include the results from the passed filters in the search.status()
Returns aConditionBuilder
that can be used to build a JQL condition for status.Adds a condition to the query that finds the issues associated with a particular set of statuses.Returns aConditionBuilder
that can be used to build a JQL condition for statusCategory.statusCategory
(String... categories) Adds a condition to the query that finds the issues associated with a particular set of statuses of a given category.sub()
Creates a new sub expression in the current JQL.summary()
Returns aConditionBuilder
that can be used to build a JQL condition for issue summaries.Adds a condition to the query that finds the issues that match the passed summary.Returns aConditionBuilder
that can be used to build a JQL condition for the issue's timeSpent field.Adds a condition to the query that finds the issues that have not been resolved.updated()
Returns aConditionBuilder
that can be used to build a JQL condition for issue's updated date.updatedAfter
(String startDate) Adds a condition to the query that finds the issues that were updated after the passed date.updatedAfter
(Date startDate) Adds a condition to the query that finds the issues that were updated after the passed date.updatedBetween
(String startDateString, String endDateString) Adds a condition to the query that finds the issues that were updated between the passed dates.updatedBetween
(Date startDate, Date endDate) Adds a condition to the query that finds the issues that were updated between the passed dates.voter()
Returns aConditionBuilder
that can be used to build a JQL condition for the voters on an issue.voterInGroup
(String groupName) Adds a condition to the query that finds all issues that were voted for by users in a particular group.Adds a condition to the query that finds all issues that were voted for by the current user.Adds a condition to the query to find issues without any votes.Adds a condition to the query that finds issues that are voted for by the passed user.votes()
Returns aConditionBuilder
that can be used to build a JQL condition for the number of votes on an issue.watcher()
Returns aConditionBuilder
that can be used to build a JQL condition for the watchers on an issue.watcherInGroup
(String groupName) Adds a condition to the query that finds all issues that were watched by users in a particular group.Adds a condition to the query that finds all issues that were watched by the current user.Adds a condition to the query to find issues without any watchers.watcherUser
(String userName) Adds a condition to the query that finds issues that are watched by the passed user.watches()
Returns aConditionBuilder
that can be used to build a JQL condition for the number of watches on an issue.Returns aConditionBuilder
that can be used to build a JQL condition for the issue's work ratio field.
-
Method Details
-
endWhere
JqlQueryBuilder endWhere()Gets a handle on the associatedJqlQueryBuilder
.- Returns:
- the associated
JqlQueryBuilder
. Null may be returned to indicate there is no associated builder.
-
buildQuery
Query buildQuery()Builds aQuery
using the current builder. WhenendWhere()
is not null, this equates to callingendWhere().buildQuery()
. WhenendWhere()
is null, this equates to callingnew QueryImpl(buildClause())
.- Returns:
- the newly generated query.
- Throws:
IllegalStateException
- if it is not possible to build the current query given the state of the builder.
-
clear
JqlClauseBuilder clear()Reset the builder to its empty state.- Returns:
- the reset builder.
-
defaultAnd
JqlClauseBuilder defaultAnd()Combines JQL conditions using the "AND" operator when none has been specified. Normally the caller must ensure that a call to eitherand()
oror()
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 eitherand
oror
have been made. This mode will remain active until one ofdefaultNone()
,defaultOr()
orclear()
is called.While in this mode, it is still possible to explicitly call
and
oror
to override the default operator for the current condition. For examplebuilder.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.
-
defaultOr
JqlClauseBuilder defaultOr()Combines JQL conditions using the "OR" operator when none has been specified. Normally the caller must ensure that a call to eitherand()
oror()
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 eitherand
oror
have been made. This mode will remain active until one ofdefaultNone()
,defaultAnd()
orclear()
is called.While in this mode, it is still possible to explicitly call
and
oror
to override the default operator for the current condition. For examplebuilder.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.
-
defaultNone
JqlClauseBuilder defaultNone()Stops injecting JQL "AND" or "OR" operators automatically between the generated JQL conditions. This turns off the behavior started by calling eitherdefaultAnd()
ordefaultOr()
.- Returns:
- a builder that can be used to further extends the current JQL expression.
-
and
JqlClauseBuilder and()Adds the JQL "AND" operator to the JQL expression currently being built. The builder takes into account operator precedence when generating the JQL expression, and as such, the caller may need to group JQL conditions using thesub()
andendsub()
calls. For example,builder.not().affectedVersion("11").and().effectedVersion("12")
produces the JQLNOT (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 JQLNOT (affectedVersion = "11" and affectedVersion = "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.
-
or
JqlClauseBuilder or()Adds the JQL "OR" operator to the JQL expression currently being built. The builder takes into account operator precedence when generating the JQL expression, and as such, the caller may need to group JQL conditions using thesub()
andendsub()
calls. For example,builder.issueType("bug").and().affectedVersion("11").or().affectedVersion("12")
produces the JQL(issueType = "bug" and affectedVersion = "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 JQLissueType = "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.
-
not
JqlClauseBuilder not()Adds the JQL "NOT" operator to the JQL expression currently being built. The builder takes into account operator precedence when generating the JQL expression, and as such, the caller may need to group JQL conditions using thesub()
andendsub()
calls. For example,builder.not().affectedVersion("11").and().effectedVersion("12")
produces the JQLNOT (affectedVersion = "11") and affectedVersion = "12"
as the"AND" operator
has a lower precedence than "NOT". On the other hand,builder.not().sub().affectedVersion("11").and().effectedVersion("12").endsub()
produces the JQLNOT(affectedVersion = "11" and affectedVersion = "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.
-
sub
JqlClauseBuilder sub()Creates a new sub expression in the current JQL. This opens a bracket in the JQL query such that all the JQL expressions from now until the next matchingclose 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" or affectedVersion = "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.- See Also:
-
endsub
JqlClauseBuilder endsub()Ends the current sub JQL expression. This adds a close bracket to the JQL query which will close the lastopen bracket
.- Returns:
- a reference to the current builder.
- Throws:
IllegalStateException
- if there is no current sub expression to close, that is, there is no matching call tosub()
.- See Also:
-
affectedVersion
Adds a condition to the query that finds the issues associated with a particular affected version. This adds the JQL conditionaffectedVersion = "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.
-
affectedVersion
Adds a condition to the query that finds the issues associated with a particular set of affected versions. This adds the JQL conditionaffectedVersion 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.
-
affectedVersionIsEmpty
JqlClauseBuilder affectedVersionIsEmpty()Adds a condition to the query to find issues with no assigned affected version. This adds the JQL conditionaffectedVersion 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.
-
affectedVersion
ConditionBuilder affectedVersion()Returns aConditionBuilder
that can be used to build a JQL condition for the affected version.- Returns:
- a reference to a condition builder for affected version.
-
fixVersion
Adds a condition to the query that finds the issues associated with a particular fix version. This adds the JQL conditionfixVersion = "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.
-
fixVersion
Adds a condition to the query that finds the issues associated with a particular set of fix versions. This adds the JQL conditionfixVersion 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.
-
fixVersion
Adds a condition to the query that finds the issues associated with a particular fix version. This adds the JQL conditionfixVersion = 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.
-
fixVersion
Adds a condition to the query that finds the issues associated with a particular set of fix versions. This adds the JQL conditionfixVersion 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.
-
fixVersionIsEmpty
JqlClauseBuilder fixVersionIsEmpty()Adds a condition to the query to find issues with no assigned fix version. This adds the JQL conditionfixVersion 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.
-
fixVersion
ConditionBuilder fixVersion()Returns aConditionBuilder
that can be used to build a JQL condition for the fix version.- Returns:
- a reference to a ConditionBuilder for fix version.
-
priority
Adds a condition to the query that finds the issues associated with a particular set of priorities. This adds the JQL conditionpriority 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.
-
priority
ConditionBuilder priority()Returns aConditionBuilder
that can be used to build a JQL condition for the priority.- Returns:
- a reference to a ConditionBuilder for priority.
-
resolution
Adds a condition to the query that finds the issues associated with a particular set of resolutions. This adds the JQL conditionresolution in (resolutions)
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.
-
unresolved
JqlClauseBuilder unresolved()Adds a condition to the query that finds the issues that have not been resolved. This adds the JQL conditionresolution 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.
-
resolution
ConditionBuilder resolution()Returns aConditionBuilder
that can be used to build a JQL condition for resolution.- Returns:
- a reference to a ConditionBuilder for resolution.
-
status
Adds a condition to the query that finds the issues associated with a particular set of statuses. This adds the JQL conditionstatus 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.
-
status
ConditionBuilder status()Returns aConditionBuilder
that can be used to build a JQL condition for status.- Returns:
- a reference to a ConditionBuilder for status.
-
statusCategory
Adds a condition to the query that finds the issues associated with a particular set of statuses of a given category. This adds the JQL conditionstatusCategory in (categories)
to the query being built.- Parameters:
categories
- the Jira status categories to search for. Each category can be specified either by its name (e.g. "new") or by its Jira ID as a string (e.g. "2"). 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.- Since:
- v6.2
-
statusCategory
ConditionBuilder statusCategory()Returns aConditionBuilder
that can be used to build a JQL condition for statusCategory.- Returns:
- a reference to a ConditionBuilder for statusCategory.
- Since:
- v6.2
-
issueType
Adds a condition to the query that finds the issues of a particular type. This adds the JQL conditionissueType 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.
-
issueTypeIsStandard
JqlClauseBuilder issueTypeIsStandard()Adds a condition to the query that finds the "standard" issue types. Standard issues types are those that are not sub-tasks. This adds the JQL conditionissueType 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.
-
issueTypeIsSubtask
JqlClauseBuilder issueTypeIsSubtask()Adds a condition to the query that finds the "sub-task" issue types. This adds the JQL conditionissueType 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.
-
issueType
ConditionBuilder issueType()Returns aConditionBuilder
that can be used to build a JQL condition for issue types.- Returns:
- a reference to a ConditionBuilder for issue types.
-
description
Adds a condition to the query that finds the issues that match the passed description. This adds the conditiondescription ~ "value"
to the query being built.NOTE: The description field performs approximate 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.
-
descriptionIsEmpty
JqlClauseBuilder descriptionIsEmpty()Adds a condition to the query that finds the issues that have no description. This adds the conditiondescription 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.
-
description
ConditionBuilder description()Returns aConditionBuilder
that can be used to build a JQL condition for issue descriptions.- Returns:
- a reference to a ConditionBuilder for issue descriptions.
-
summary
Adds a condition to the query that finds the issues that match the passed summary. This adds the conditionsummary ~ "value"
to the query being built.NOTE: The summary field performs approximate 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.
-
summary
ConditionBuilder summary()Returns aConditionBuilder
that can be used to build a JQL condition for issue summaries.- Returns:
- a reference to a ConditionBuilder for issue summaries.
-
environment
Adds a condition to the query that finds the issues that match the passed environment. This adds the conditionenvironment ~ "value"
to the query being built.NOTE: The environment field performs approximate 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.
-
environmentIsEmpty
JqlClauseBuilder environmentIsEmpty()Adds a condition to the query that finds the issues that have no environment. This adds the conditionenvironment 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.
-
environment
ConditionBuilder environment()Returns aConditionBuilder
that can be used to build a JQL condition for issue environments.- Returns:
- a reference to a ConditionBuilder for issue environments.
-
comment
Adds a condition to the query that finds the issues that match the passed comment. This adds the conditioncomment ~ "value"
to the query being built.NOTE: The comment field performs approximate 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.
-
comment
ConditionBuilder comment()Returns aConditionBuilder
that can be used to build a JQL condition for issue comments.- Returns:
- a reference to a ConditionBuilder for issue comments.
-
project
Adds a condition to the query that finds the issues within a particular project. This adds the JQL conditionproject 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.
-
project
Adds a condition to the query that finds the issues within a particular project. This adds the JQL conditionproject 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.
-
project
ConditionBuilder project()Returns aConditionBuilder
that can be used to build a JQL condition for an issue's project.- Returns:
- a reference to a ConditionBuilder for projects
-
category
Adds a condition to the query that finds the issues from projects within a list of project categories. This adds the JQL conditioncategory in (categories)
to the query being built.- Parameters:
categories
- the Jira project categories for the condition. Each project category 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.
-
category
ConditionBuilder category()Returns aConditionBuilder
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.
-
createdAfter
Adds a condition to the query that finds the issues that were created after the passed date. This adds the querycreated >= 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.
-
createdAfter
Adds a condition to the query that finds the issues that were created after the passed date. This adds the querycreated >= 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.
-
createdBetween
Adds a condition to the query that finds the issues that were created between the passed dates. This adds the querycreated >= startDate AND created <= 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-nullstartDate
with a nullendDate
will add the conditioncreated >= startDate
. Passing a non-nullendDate
with a nullstartDate
will add the conditioncreated <= endDate
. Passing a nullstartDate
and nullendDate
is illegal.- Parameters:
startDate
- the date that issues must be created on or after. May be null ifendDate
is not null.endDate
- the date that issues must be created on or before. May be null ifstartDate
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 bothstartDate
andendDate
are null.
-
createdBetween
Adds a condition to the query that finds the issues that where created between the passed dates. This adds the querycreated >= startDateString AND created <= 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-nullstartDateString
with a nullendDateString
will add the conditioncreated >= startDateString
. Passing a non-nullendDateString
with a nullstartDateString
will add the conditioncreated <= endDateString
. Passing a nullstartDateString
and nullendDateString
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 ifendDateString
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 ifstartDateString
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 bothstartDateString
andendDateString
are null.
-
created
ConditionBuilder created()Returns aConditionBuilder
that can be used to build a JQL condition for issue's creation date.- Returns:
- a reference to a ConditionBuilder for created date.
-
updatedAfter
Adds a condition to the query that finds the issues that were updated after the passed date. This adds the queryupdated >= 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.
-
updatedAfter
Adds a condition to the query that finds the issues that were updated after the passed date. This adds the queryupdated >= 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.
-
updatedBetween
Adds a condition to the query that finds the issues that were updated between the passed dates. This adds the queryupdated >= startDate AND updated <= 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-nullstartDate
with a nullendDate
will add the conditionupdated >= startDate
. Passing a non-nullendDate
with a nullstartDate
will add the conditionupdated <= endDate
. Passing a nullstartDate
and nullendDate
is illegal.- Parameters:
startDate
- the date that issues must be updated on or after. May be null ifendDate
is not null.endDate
- the date that issues must be updated on or before. May be null ifstartDate
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 bothstartDate
andendDate
are null.
-
updatedBetween
Adds a condition to the query that finds the issues that were updated between the passed dates. This adds the queryupdated >= startDateString AND updated <= endDateString
to the query being built. It is also possible to create an open interval by passing one of the arguments asnull
. Passing a non-nullstartDateString
with a nullendDateString
will add the conditionupdated >= startDateString
. Passing a non-nullendDateString
with a nullstartDateString
will add the conditionupdated <= endDateString
. Passing a nullstartDateString
and nullendDateString
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 ifendDateString
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 ifstartDateString
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 bothstartDateString
andendDateString
are null.
-
updated
ConditionBuilder updated()Returns aConditionBuilder
that can be used to build a JQL condition for issue's updated date.- Returns:
- a reference to a ConditionBuilder for updated date.
-
dueAfter
Adds a condition to the query that finds the issues that are due after the passed date. This adds the querydueDate >= 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.
-
dueAfter
Adds a condition to the query that finds the issues that are due after the passed date. This adds the querydueDate >= 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.
-
dueBetween
Adds a condition to the query that finds the issues that were due between the passed dates. This adds the querydueDate >= startDate AND dueDate <= endDate
to the query being built. It is also possible to create an open interval by passing one of the arguments asnull
. Passing a non-nullstartDate
with a nullendDate
will add the conditiondueDate >= startDate
. Passing a non-nullendDate
with a nullstartDate
will add the conditiondueDate <= endDate
. Passing a nullstartDate
and nullendDate
is illegal.- Parameters:
startDate
- the date that issues must be due on or after. May be null ifendDate
is not null.endDate
- the date that issues must be due on or before. May be null ifstartDate
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 bothstartDate
andendDate
are null.
-
dueBetween
Adds a condition to the query that finds the issues that were due between the passed dates. This adds the querydueDate >= startDateString AND dueDate <= endDateString
to the query being built. It is also possible to create an open interval by passing one of the arguments asnull
. Passing a non-nullstartDateString
with a nullendDateString
will add the conditiondueDate >= startDateString
. Passing a non-nullendDateString
with a nullstartDateString
will add the conditiondueDate <= endDateString
. Passing a nullstartDateString
and nullendDateString
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 ifendDateString
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 ifstartDateString
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 bothstartDateString
andendDateString
are null.
-
due
ConditionBuilder due()Returns aConditionBuilder
that can be used to build a JQL condition for issue's due date.- Returns:
- a reference to a ConditionBuilder for due date.
-
lastViewedAfter
Adds a condition to the query that finds the issues that were last viewed after the passed date (if issue is stored in history). This adds the querylastViewed >= 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.
-
lastViewedAfter
Adds a condition to the query that finds the issues that were viewed after the passed date (if issue is stored in history). This adds the querylastViewed >= 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.
-
lastViewedBetween
Adds a condition to the query that finds the issues that were viewed between the passed dates. This adds the querylastViewed >= startDate AND lastViewed <= endDate
to the query being built. It is also possible to create an open interval by passing one of the arguments asnull
. Passing a non-nullstartDate
with a nullendDate
will add the conditionlastViewed >= startDate
. Passing a non-nullendDate
with a nullstartDate
will add the conditionlastViewed <= endDate
. Passing a nullstartDate
and nullendDate
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 ifendDate
is not null.endDate
- the date that issues must be viewed on or before. May be null ifstartDate
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 bothstartDate
andendDate
are null.
-
lastViewedBetween
Adds a condition to the query that finds the issues that were last viewed between the passed dates. This adds the querylastViewed >= startDateString AND lastViewed <= endDateString
to the query being built. It is also possible to create an open interval by passing one of the arguments asnull
. Passing a non-nullstartDateString
with a nullendDateString
will add the conditionlastViewed >= startDateString
. Passing a non-nullendDateString
with a nullstartDateString
will add the conditionlastViewed <= endDateString
. Passing a nullstartDateString
and nullendDateString
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 ifendDateString
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 ifstartDateString
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 bothstartDateString
andendDateString
are null.
-
lastViewed
ConditionBuilder lastViewed()Returns aConditionBuilder
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.
-
resolutionDateAfter
Adds a condition to the query that finds the issues that were resolved after the passed date. This adds the queryresolutionDate >= 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.
-
resolutionDateAfter
Adds a condition to the query that finds the issues that were resolved after the passed date. This adds the queryresolutionDate >= 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.
-
resolutionDateBetween
Adds a condition to the query that finds the issues that were resolved between the passed dates. This adds the queryresolutionDate >= startDate AND resolutiondDate <= endDate
to the query being built. It is also possible to create an open interval by passing one of the arguments asnull
. Passing a non-nullstartDate
with a nullendDate
will add the conditionresolutionDate >= startDate
. Passing a non-nullendDate
with a nullstartDate
will add the conditionresolutionDate <= endDate
. Passing a nullstartDate
and nullendDate
is illegal.- Parameters:
startDate
- the date that issues must be resolved on or after. May be null ifendDate
is not null.endDate
- the date that issues must be resolved on or before. May be null ifstartDate
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 bothstartDate
andendDate
are null.
-
resolutionDateBetween
Adds a condition to the query that finds the issues that were resolved between the passed dates. This adds the queryresolutionDate >= startDateString AND resolutionDate <= endDateString
to the query being built. It is also possible to create an open interval by passing one of the arguments asnull
. Passing a non-nullstartDateString
with a nullendDateString
will add the conditionresolutionDate >= startDateString
. Passing a non-nullendDateString
with a nullstartDateString
will add the conditionresolutionDate <= endDateString
. Passing a nullstartDateString
and nullendDateString
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 ifendDateString
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 ifstartDateString
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 bothstartDateString
andendDateString
are null.
-
resolutionDate
ConditionBuilder resolutionDate()Returns aConditionBuilder
that can be used to build a JQL condition for issue's resolution date.- Returns:
- a reference to a ConditionBuilder for resolution date.
-
reporterUser
Adds a condition to the query that finds issues that where reported by the passed user. This adds the conditionreporter = 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.
-
reporterInGroup
Adds a condition to the query that finds all issues that were reported by users in a particular group. This adds the conditionreporter 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.
-
reporterIsCurrentUser
JqlClauseBuilder reporterIsCurrentUser()Adds a condition to the query that finds all issues that were reported by the current user. This adds the conditionreporter = 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.
-
reporterIsEmpty
JqlClauseBuilder reporterIsEmpty()Adds a condition to the query to find issues without a reporter. This adds the conditionreporter 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.
-
reporter
ConditionBuilder reporter()Returns aConditionBuilder
that can be used to build a JQL condition for the issue's reporter.- Returns:
- a reference to a ConditionBuilder for reporter.
-
assigneeUser
Adds a condition to the query that finds issues that are assigned to the passed user. This adds the conditionassignee = 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.
-
assigneeInGroup
Adds a condition to the query that finds all issues that are assigned to users in a particular group. This adds the conditionassignee 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.
-
assigneeIsCurrentUser
JqlClauseBuilder assigneeIsCurrentUser()Adds a condition to the query that finds all issues that are assigned to the current user. This adds the conditionassignee = 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.
-
assigneeIsEmpty
JqlClauseBuilder assigneeIsEmpty()Adds a condition to the query to find all unassigned issues. This adds the conditionassignee 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.
-
assignee
ConditionBuilder assignee()Returns aConditionBuilder
that can be used to build a JQL condition for the issue's assignee.- Returns:
- a reference to a ConditionBuilder for assignee.
-
component
Add a condition to the query to find all issues with particular components. This adds the JQL conditioncomponent 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.
-
component
Adds a condition to the query to find all issues with particular components. This adds the JQL conditioncomponent 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.
-
componentIsEmpty
JqlClauseBuilder componentIsEmpty()Adds a condition to the query to find all issues that have not component assigned. This adds the JQL conditioncomponent IS EMPTY
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.
-
component
ConditionBuilder component()Returns aConditionBuilder
that can be used to build a JQL condition for the issue's component.- Returns:
- a reference to a ConditionBuilder for component.
-
labels
Adds a condition to the query to find all issues with particular labels. This adds the JQL conditionlabels 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.
-
labelsIsEmpty
JqlClauseBuilder labelsIsEmpty()Adds a condition to the query to find all issues that have no labels. This adds the JQL conditionlabels IS EMPTY
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.
-
labels
ConditionBuilder labels()Returns aConditionBuilder
that can be used to build a JQL condition for the issue's labels.- Returns:
- a reference to a ConditionBuilder for labels.
-
issue
Adds a condition to the query that will find all issues with the passed key. This adds the JQL conditionkey 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.
-
issueInHistory
JqlClauseBuilder issueInHistory()Adds a condition to the query that will find all issues currently within the user's history. This adds the JQL conditionkey 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.
-
issueInWatchedIssues
JqlClauseBuilder issueInWatchedIssues()Adds a condition to the query that will find all issues currently watched by the user. This adds the JQL conditionkey 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.
-
issueInVotedIssues
JqlClauseBuilder issueInVotedIssues()Adds a condition to the query that will find all issues the user has voted on. This adds the JQL conditionkey 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.
-
issue
ConditionBuilder issue()Returns aConditionBuilder
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.
-
issueParent
Adds a condition to the query that will find all issues that have the passed issues as parents. This adds the conditionparent 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.
-
issueParent
ConditionBuilder issueParent()Returns aConditionBuilder
that can be used to build a JQL condition for the issue's parent.- Returns:
- a reference to a ConditionBuilder for issue parent.
-
currentEstimate
ConditionBuilder currentEstimate()Returns aConditionBuilder
that can be used to build a JQL condition for the issue's current estimate.- Returns:
- a reference to a ConditionBuilder for current estimate.
-
originalEstimate
ConditionBuilder originalEstimate()Returns aConditionBuilder
that can be used to build a JQL condition for the issue's original estimate.- Returns:
- a reference to a ConditionBuilder for original estimate.
-
timeSpent
ConditionBuilder timeSpent()Returns aConditionBuilder
that can be used to build a JQL condition for the issue's timeSpent field.- Returns:
- a reference to a ConditionBuilder for timeSpent.
-
workRatio
ConditionBuilder workRatio()Returns aConditionBuilder
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.
-
level
Adds a condition to the query that will find all issues with the passed security levels. This adds the conditionlevel 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.
-
level
ConditionBuilder level()Returns aConditionBuilder
that can be used to build a JQL condition for the issue's security level.- Returns:
- a reference to a ConditionBuilder for issue level.
-
savedFilter
Adds a condition to the query that will include the results from the passed filters in the search. This adds the conditionfilter 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.
-
savedFilter
ConditionBuilder savedFilter()Returns aConditionBuilder
that can be used to add saved filters as conditions to the query.- Returns:
- a reference to a ConditionBuilder for saved filters.
-
votes
ConditionBuilder votes()Returns aConditionBuilder
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.
-
voterUser
Adds a condition to the query that finds issues that are voted for by the passed user. This adds the conditionvoter = 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.
-
voterInGroup
Adds a condition to the query that finds all issues that were voted for by users in a particular group. This adds the conditionvoter 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.
-
voterIsCurrentUser
JqlClauseBuilder voterIsCurrentUser()Adds a condition to the query that finds all issues that were voted for by the current user. This adds the conditionvoter = 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.
-
voterIsEmpty
JqlClauseBuilder voterIsEmpty()Adds a condition to the query to find issues without any votes. This adds the conditionvoter 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.
-
voter
ConditionBuilder voter()Returns aConditionBuilder
that can be used to build a JQL condition for the voters on an issue.- Returns:
- a reference to a ConditionBuilder for votes.
-
watches
ConditionBuilder watches()Returns aConditionBuilder
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.
-
watcherUser
Adds a condition to the query that finds issues that are watched by the passed user. This adds the conditionwatcher = 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.
-
attachmentsExists
Adds a condition to the query that finds issues which contain/do not contain attachments.- Parameters:
hasAttachment
- true if expecting issues with attachments.- 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.
-
watcherInGroup
Adds a condition to the query that finds all issues that were watched by users in a particular group. This adds the conditionwatcher 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.
-
watcherIsCurrentUser
JqlClauseBuilder watcherIsCurrentUser()Adds a condition to the query that finds all issues that were watched by the current user. This adds the conditionwatcher = 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.
-
watcherIsEmpty
JqlClauseBuilder watcherIsEmpty()Adds a condition to the query to find issues without any watchers. This adds the conditionwatcher 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.
-
watcher
ConditionBuilder watcher()Returns aConditionBuilder
that can be used to build a JQL condition for the watchers on an issue.- Returns:
- a reference to a ConditionBuilder for watcher.
-
field
Returns aConditionBuilder
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.
-
customField
Returns aConditionBuilder
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.
-
addClause
Adds 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.
-
addDateCondition
Adds the JQL conditionclauseName operator date
to the query being built.- Parameters:
clauseName
- name of the clause in the condition. Must not be null.operator
- one of the enumeratedOperator
s. 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.
-
addDateCondition
Adds the JQL conditionclauseName 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.
-
addDateCondition
Adds the JQL conditionclauseName operator (clauseValues)
to the query being built.- Parameters:
clauseName
- name of the clause in the condition. Must not be null.operator
- one of the enumeratedOperator
s. 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.
-
addDateCondition
Adds the JQL conditionclauseName 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.
-
addDateCondition
Adds the JQL conditionclauseName operator (clauseValues)
to the query being built.- Parameters:
clauseName
- name of the clause in the condition. Must not be null.operator
- one of the enumeratedOperator
s. 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.
-
addDateRangeCondition
Adds a condition range condition to the current query for the passed dates. This adds the queryclauseName >= startDate AND clauseName <= endDate
to the query being built. It is also possible to create an open interval by passing one of the arguments asnull
. Passing a non-nullstartDate
with a nullendDate
will add the conditionclauseName >= startDate
. Passing a non-nullendDate
with a nullstartDate
will add the conditionclauseName <= endDate
. Passing a nullstartDate
and nullendDate
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 ifendDate
is not null.endDate
- the date for the end of the range. May be null ifstartDate
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 bothstartDate
andendDate
are null.
-
addFunctionCondition
Adds the JQL conditionclauseName = 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.
-
addFunctionCondition
Adds the JQL conditionclauseName = 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.
-
addFunctionCondition
JqlClauseBuilder addFunctionCondition(String clauseName, String functionName, Collection<String> args) Adds the JQL conditionclauseName = 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.
-
addFunctionCondition
Adds the JQL conditionclauseName operator functionName()
to the query being built.- Parameters:
clauseName
- name of the clause in the condition. Must not be null.operator
- one of the enumeratedOperator
s. 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.
-
addFunctionCondition
JqlClauseBuilder addFunctionCondition(String clauseName, Operator operator, String functionName, String... args) Adds the JQL conditionclauseName 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 enumeratedOperator
s. 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.
-
addFunctionCondition
JqlClauseBuilder addFunctionCondition(String clauseName, Operator operator, String functionName, Collection<String> args) Adds the JQL conditionclauseName 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 enumeratedOperator
s. 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.
-
addStringCondition
Adds the JQL conditionclauseName = "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.
-
addStringCondition
Adds the JQL conditionclauseName 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.
-
addStringCondition
Adds the JQL conditionclauseName 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.
-
addFieldReferenceCondition
Adds the JQL conditionclauseName in (clauseValues)
in form of field reference to the query being built.- Parameters:
ref
- aJqlFieldReference
to describe completed custom field referenceclauseValues
- string values for the condition. Must not be null, empty or contain any null values.- Returns:
- a reference to the current builder.
-
addStringCondition
Adds the JQL conditionclauseName operator "clauseValue"
to the query being built.- Parameters:
clauseName
- name of the clause in the condition. Must not be null.operator
- one of the enumeratedOperator
s. 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.
-
addStringCondition
Adds the JQL conditionclauseName operator (clauseValues)
to the query being built.- Parameters:
clauseName
- name of the clause in the condition. Must not be null.operator
- one of the enumeratedOperator
s. 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.
-
addStringCondition
JqlClauseBuilder addStringCondition(String clauseName, Operator operator, Collection<String> clauseValues) Adds the JQL conditionclauseName operator (clauseValues)
to the query being built.- Parameters:
clauseName
- name of the clause in the condition. Must not be null.operator
- one of the enumeratedOperator
s. 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.
-
addStringRangeCondition
Adds a condition range condition to the current query for the passed values. This adds the queryclauseName >= start AND clauseName <= end
to the query being built. It is also possible to create an open interval by passing one of the arguments asnull
. Passing a non-nullstart
with a nullend
will add the conditionclauseName >= start
. Passing a non-nullend
with a nullstart
will add the conditionclauseName <= end
. Passing a nullstart
and nullend
is illegal.- Parameters:
clauseName
- name of the clause in the condition. Must not be null.start
- the start of the range. May be null ifend
is not null.end
- the end of the range. May be null ifstart
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 bothstart
andend
are null.
-
addNumberCondition
Adds the JQL conditionclauseName = 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.
-
addNumberCondition
Adds the JQL conditionclauseName 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.
-
addNumberCondition
Adds the JQL conditionclauseName 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.
-
addNumberCondition
Adds the JQL conditionclauseName operator clauseValue
to the query being built.- Parameters:
clauseName
- name of the clause in the condition. Must not be null.operator
- one of the enumeratedOperator
s. 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.
-
addNumberCondition
Adds the JQL conditionclauseName operator (clauseValues)
to the query being built.- Parameters:
clauseName
- name of the clause in the condition. Must not be null.operator
- one of the enumeratedOperator
s. 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.
-
addNumberCondition
JqlClauseBuilder addNumberCondition(String clauseName, Operator operator, Collection<Long> clauseValues) Add the JQL conditionclauseName operator (clauseValues)
to the query being built.- Parameters:
clauseName
- name of the clause in the condition. Must not be null.operator
- one of the enumeratedOperator
s. 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.
-
addNumberRangeCondition
Adds a condition range condition to the current query for the passed values. This adds the queryclauseName >= start AND clauseName <= end
to the query being built. It is also possible to create an open interval by passing one of the arguments asnull
. Passing a non-nullstart
with a nullend
will add the conditionclauseName >= start
. Passing a non-nullend
with a nullstart
will add the conditionclauseName <= end
. Passing a nullstart
and nullend
is illegal.- Parameters:
clauseName
- name of the clause in the condition. Must not be null.start
- the start of the range. May be null ifend
is not null.end
- the end of the range. May be null ifstart
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 bothstart
andend
are null.
-
addCondition
Returns aConditionBuilder
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.
-
addCondition
Adds the JQL conditionclauseName = 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.
-
addCondition
Adds the JQL conditionclauseName 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.
-
addCondition
Add the JQL conditionclauseName 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.
-
addCondition
Adds the JQL conditionclauseName operator operand
to the query being built.- Parameters:
clauseName
- name of the clause in the condition. Must not be null.operator
- one of the enumeratedOperator
s. 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.
-
addCondition
Adds the JQL conditionclauseName operator (operands)
to the query being built.- Parameters:
clauseName
- name of the clause in the condition. Must not be null.operator
- one of the enumeratedOperator
s. 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.
-
addCondition
JqlClauseBuilder addCondition(String clauseName, Operator operator, Collection<? extends Operand> operands) Adds the JQL conditionclauseName operator (operands)
to the query being built.- Parameters:
clauseName
- name of the clause in the condition. Must not be null.operator
- one of the enumeratedOperator
s. 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.
-
addRangeCondition
Adds a condition range condition to the current query for the passed values. This adds the queryclauseName >= start AND clauseName <= end
to the query being built. It is also possible to create an open interval by passing one of the arguments asnull
. Passing a non-nullstart
with a nullend
will add the conditionclauseName >= start
. Passing a non-nullend
with a nullstart
will add the conditionclauseName <= end
. Passing a nullstart
and nullend
is illegal.- Parameters:
clauseName
- name of the clause in the condition. Must not be null.start
- the start of the range. May be null ifend
is not null.end
- the end of the range. May be null ifstart
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 bothstart
andend
are null.
-
addEmptyCondition
Adds an "IS EMPTY" condition to the current query for the passed JQL clause. This adds the queryclauseName 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.
-
buildClause
Clause buildClause()Creates 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.
-