Interface JqlClauseBuilder


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

This builder 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 Details

    • endWhere

      JqlQueryBuilder endWhere()
      Gets a handle on the associated JqlQueryBuilder.
      Returns:
      the associated JqlQueryBuilder. Null may be returned to indicate there is no associated builder.
    • buildQuery

      Query buildQuery()
      Builds a Query using the current builder. When endWhere() is not null, this equates to calling endWhere().buildQuery(). When endWhere() is null, this equates to calling new QueryImpl(buildClause()).
      Returns:
      the newly generated query.
      Throws:
      IllegalStateException - if it is not possible to build the current query given the state of the builder.
    • 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 either and() or or() is placed between calls to create JQL conditions. Calling this method on the builder tells it to automatically add a JQL "AND" between JQL conditions when no calls to either and or or have been made. This mode will remain active until one of defaultNone(), defaultOr() or clear() is called.

      While in this mode, it is still possible to explicitly call and or or to override the default operator for the current condition. For example builder.where().assigneeIsEmpty().or().defaultAnd().reporterIsCurrentUser().affectedVersion("10.5").defaultOr().issueType("bug").buildQuery() will build the JQL query "assignee is empty or reporter = currentUser() and affectedVersion = '10.5' or issueType = bug".

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

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

      While in this mode, it is still possible to explicitly call and or or to override the default operator for the current condition. For example builder.where().assigneeIsEmpty().and().defaultOr().reporterIsCurrentUser().affectedVersion("10.5").defaultOr().issueType("bug").buildQuery() will build the JQL query "assignee is empty and reporter = currentUser() or affectedVersion = '10.5' or issueType = bug".

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

      JqlClauseBuilder defaultNone()
      Stops injecting JQL "AND" or "OR" operators automatically between the generated JQL conditions. This turns off the behavior started by calling either defaultAnd() or defaultOr().
      Returns:
      a builder that can be used to further extends the current JQL expression.
    • 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 the sub() and endsub() calls. For example, builder.not().affectedVersion("11").and().effectedVersion("12") produces the JQL NOT (affectedVersion = "11") and affectedVersion = "12" as the "NOT" operator has a higher precedence than "AND". On the other hand, builder.not().sub().affectedVersion("11").and().effectedVersion("12").endsub() produces the JQL NOT (affectedVersion = "11" 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

      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 the sub() and endsub() 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 JQL issueType = "bug" and (affectedVersion = "11" or affectedVersion = "12").
      Returns:
      a reference to the current builder.
      Throws:
      IllegalStateException - if it is not possible to add the OR operator given the current state of the builder.
    • 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 the sub() and endsub() calls. For example, builder.not().affectedVersion("11").and().effectedVersion("12") produces the JQL NOT (affectedVersion = "11") and affectedVersion = "12" as the "AND" operator has a lower precedence than "NOT". On the other hand, builder.not().sub().affectedVersion("11").and().effectedVersion("12").endsub() produces the JQL NOT(affectedVersion = "11" 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

      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 matching close bracket are grouped together. This can be used to override JQL's precedence rules. For example, builder.sub().affectedVersion("12").or().affectedVersion("11").endsub().and().issueType("bug") will produce the JQL query (affectedVersion = "12" 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

      Ends the current sub JQL expression. This adds a close bracket to the JQL query which will close the last open bracket.
      Returns:
      a reference to the current builder.
      Throws:
      IllegalStateException - if there is no current sub expression to close, that is, there is no matching call to sub().
      See Also:
    • affectedVersion

      JqlClauseBuilder affectedVersion(String version)
      Adds a condition to the query that finds the issues associated with a particular affected version. This adds the JQL condition affectedVersion = "value" to the query being built.
      Parameters:
      version - the version to search for. Can be passed as its name (e.g. "1.2") or the string representation of its internal Jira ID (e.g. "102020"). Must not be null.
      Returns:
      a reference to the current builder.
      Throws:
      IllegalStateException - if it is not possible to add a JQL condition given the current state of the builder.
    • affectedVersion

      JqlClauseBuilder affectedVersion(String... versions)
      Adds a condition to the query that finds the issues associated with a particular set of affected versions. This adds the JQL condition affectedVersion in (versions) to the query being built.
      Parameters:
      versions - the affected versions to search for. Each version can be specified either by its name (e.g. "1.2") or by its Jira ID as a string (e.g. "10000"). Must not be null, empty or contain any null values.
      Returns:
      a reference to the current builder.
      Throws:
      IllegalStateException - if it is not possible to add a JQL condition given the current state of the builder.
    • affectedVersionIsEmpty

      JqlClauseBuilder affectedVersionIsEmpty()
      Adds a condition to the query to find issues with no assigned affected version. This adds the JQL condition affectedVersion IS EMPTY to the query being built.
      Returns:
      a reference to the current builder.
      Throws:
      IllegalStateException - if it is not possible to add a JQL condition given the current state of the builder.
    • affectedVersion

      ConditionBuilder affectedVersion()
      Returns a ConditionBuilder that can be used to build a JQL condition for the affected version.
      Returns:
      a reference to a condition builder for affected version.
    • fixVersion

      JqlClauseBuilder fixVersion(String version)
      Adds a condition to the query that finds the issues associated with a particular fix version. This adds the JQL condition fixVersion = "value" to the query being built.
      Parameters:
      version - the version to search for. Can be passed as its name (e.g. "1.2") or the string representation of its internal Jira ID (e.g. "102020"). Must not be null.
      Returns:
      a reference to the current builder.
      Throws:
      IllegalStateException - if it is not possible to add a JQL condition given the current state of the builder.
    • fixVersion

      JqlClauseBuilder fixVersion(String... versions)
      Adds a condition to the query that finds the issues associated with a particular set of fix versions. This adds the JQL condition fixVersion in (versions) to the query being built.
      Parameters:
      versions - the fix versions to search for. Each version can be specified either by its name (e.g. "1.2") or by its Jira ID as a string (e.g. "10000"). Must not be null, empty or contain any null values.
      Returns:
      a reference to the current builder.
      Throws:
      IllegalStateException - if it is not possible to add a JQL condition given the current state of the builder.
    • fixVersion

      JqlClauseBuilder fixVersion(Long version)
      Adds a condition to the query that finds the issues associated with a particular fix version. This adds the JQL condition fixVersion = version to the query being built.
      Parameters:
      version - the version to search for. Must not be null.
      Returns:
      a reference to the current builder.
      Throws:
      IllegalStateException - if it is not possible to add a JQL condition given the current state of the builder.
    • fixVersion

      JqlClauseBuilder fixVersion(Long... versions)
      Adds a condition to the query that finds the issues associated with a particular set of fix versions. This adds the JQL condition fixVersion in (versions) to the query being built.
      Parameters:
      versions - the fix versions to search for. Must not be null, empty or contain any null values.
      Returns:
      a reference to the current builder.
      Throws:
      IllegalStateException - if it is not possible to add a JQL condition given the current state of the builder.
    • fixVersionIsEmpty

      JqlClauseBuilder fixVersionIsEmpty()
      Adds a condition to the query to find issues with no assigned fix version. This adds the JQL condition fixVersion IS EMPTY to the query being built.
      Returns:
      a reference to the current builder.
      Throws:
      IllegalStateException - if it is not possible to add a JQL condition given the current state of the builder.
    • fixVersion

      ConditionBuilder fixVersion()
      Returns a ConditionBuilder that can be used to build a JQL condition for the fix version.
      Returns:
      a reference to a ConditionBuilder for fix version.
    • priority

      JqlClauseBuilder priority(String... priorities)
      Adds a condition to the query that finds the issues associated with a particular set of priorities. This adds the JQL condition priority in (priorities) to the query being built.
      Parameters:
      priorities - the Jira priorities to search for. Each priority can be specified either by its name (e.g. "Major") or by its Jira ID as a string (e.g. "10000"). Must not be null, empty or contain any null values.
      Returns:
      a reference to the current builder.
      Throws:
      IllegalStateException - if it is not possible to add a JQL condition given the current state of the builder.
    • priority

      ConditionBuilder priority()
      Returns a ConditionBuilder that can be used to build a JQL condition for the priority.
      Returns:
      a reference to a ConditionBuilder for priority.
    • resolution

      JqlClauseBuilder resolution(String... resolutions)
      Adds a condition to the query that finds the issues associated with a particular set of resolutions. This adds the JQL condition resolution 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 condition resolution IS EMPTY to the query being built.
      Returns:
      a reference to the current builder.
      Throws:
      IllegalStateException - if it is not possible to add a JQL condition given the current state of the builder.
    • resolution

      ConditionBuilder resolution()
      Returns a ConditionBuilder that can be used to build a JQL condition for resolution.
      Returns:
      a reference to a ConditionBuilder for resolution.
    • status

      JqlClauseBuilder status(String... statuses)
      Adds a condition to the query that finds the issues associated with a particular set of statuses. This adds the JQL condition status in (statuses) to the query being built.
      Parameters:
      statuses - the Jira statuses to search for. Each status can be specified either by its name (e.g. "Won't Fix") or by its Jira ID as a string (e.g. "10000"). Must not be null, empty or contain any null values.
      Returns:
      a reference to the current builder.
      Throws:
      IllegalStateException - if it is not possible to add a JQL condition given the current state of the builder.
    • status

      Returns a ConditionBuilder that can be used to build a JQL condition for status.
      Returns:
      a reference to a ConditionBuilder for status.
    • statusCategory

      JqlClauseBuilder statusCategory(String... categories)
      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 condition statusCategory 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 a ConditionBuilder that can be used to build a JQL condition for statusCategory.
      Returns:
      a reference to a ConditionBuilder for statusCategory.
      Since:
      v6.2
    • issueType

      JqlClauseBuilder issueType(String... types)
      Adds a condition to the query that finds the issues of a particular type. This adds the JQL condition issueType in (types) to the query being built.
      Parameters:
      types - the Jira issue types to search for. Each type can be specified either by its name (e.g. "Bug") or by its Jira ID as a string (e.g. "10000"). Must not be null, empty or contain any null values.
      Returns:
      a reference to the current builder.
      Throws:
      IllegalStateException - if it is not possible to add a JQL condition given the current state of the builder.
    • 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 condition issueType in standardIssueTypes() to the query being built.
      Returns:
      a reference to the current builder.
      Throws:
      IllegalStateException - if it is not possible to add a JQL condition given the current state of the builder.
    • issueTypeIsSubtask

      JqlClauseBuilder issueTypeIsSubtask()
      Adds a condition to the query that finds the "sub-task" issue types. This adds the JQL condition issueType in subTaskIssueTypes() to the query being built.
      Returns:
      a reference to the current builder.
      Throws:
      IllegalStateException - if it is not possible to add a JQL condition given the current state of the builder.
    • issueType

      ConditionBuilder issueType()
      Returns a ConditionBuilder that can be used to build a JQL condition for issue types.
      Returns:
      a reference to a ConditionBuilder for issue types.
    • description

      JqlClauseBuilder description(String value)
      Adds a condition to the query that finds the issues that match the passed description. This adds the condition description ~ "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 condition description IS EMPTY to the query being built.
      Returns:
      a reference to the current builder.
      Throws:
      IllegalStateException - if it is not possible to add a JQL condition given the current state of the builder.
    • description

      ConditionBuilder description()
      Returns a ConditionBuilder that can be used to build a JQL condition for issue descriptions.
      Returns:
      a reference to a ConditionBuilder for issue descriptions.
    • summary

      JqlClauseBuilder summary(String value)
      Adds a condition to the query that finds the issues that match the passed summary. This adds the condition summary ~ "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 a ConditionBuilder that can be used to build a JQL condition for issue summaries.
      Returns:
      a reference to a ConditionBuilder for issue summaries.
    • environment

      JqlClauseBuilder environment(String value)
      Adds a condition to the query that finds the issues that match the passed environment. This adds the condition environment ~ "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 condition environment IS EMPTY to the query being built.
      Returns:
      a reference to the current builder.
      Throws:
      IllegalStateException - if it is not possible to add a JQL condition given the current state of the builder.
    • environment

      ConditionBuilder environment()
      Returns a ConditionBuilder that can be used to build a JQL condition for issue environments.
      Returns:
      a reference to a ConditionBuilder for issue environments.
    • comment

      JqlClauseBuilder comment(String value)
      Adds a condition to the query that finds the issues that match the passed comment. This adds the condition comment ~ "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 a ConditionBuilder that can be used to build a JQL condition for issue comments.
      Returns:
      a reference to a ConditionBuilder for issue comments.
    • project

      JqlClauseBuilder project(String... projects)
      Adds a condition to the query that finds the issues within a particular project. This adds the JQL condition project in (projects) to the query being built.
      Parameters:
      projects - the Jira projects to search for. Each project can be specified by its name (e.g. "Jira"), its key (e.g. "JRA") or by its Jira ID as a string (e.g. "10000"). Must not be null, empty or contain any null values.
      Returns:
      a reference to the current builder.
      Throws:
      IllegalStateException - if it is not possible to add a JQL condition given the current state of the builder.
    • project

      JqlClauseBuilder project(Long... pids)
      Adds a condition to the query that finds the issues within a particular project. This adds the JQL condition project in (pids) to the query being built.
      Parameters:
      pids - the Jira id's of the projects to search for. Cannot be null, empty or contain null values.
      Returns:
      a reference to the current builder.
      Throws:
      IllegalStateException - if it is not possible to add a JQL condition given the current state of the builder.
    • project

      ConditionBuilder project()
      Returns a ConditionBuilder that can be used to build a JQL condition for an issue's project.
      Returns:
      a reference to a ConditionBuilder for projects
    • category

      JqlClauseBuilder category(String... categories)
      Adds a condition to the query that finds the issues from projects within a list of project categories. This adds the JQL condition category 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 a ConditionBuilder that can be used to build a JQL condition for issue's in a particular project category. An issue is in a project category only when it is in a project that is part of the category.
      Returns:
      a reference to a ConditionBuilder for project category.
    • createdAfter

      JqlClauseBuilder createdAfter(Date startDate)
      Adds a condition to the query that finds the issues that were created after the passed date. This adds the query created >= 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

      JqlClauseBuilder createdAfter(String startDate)
      Adds a condition to the query that finds the issues that were created after the passed date. This adds the query created >= 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

      JqlClauseBuilder createdBetween(Date startDate, Date endDate)
      Adds a condition to the query that finds the issues that were created between the passed dates. This adds the query created >= 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-null startDate with a null endDate will add the condition created >= startDate. Passing a non-null endDate with a null startDate will add the condition created <= endDate. Passing a null startDate and null endDate is illegal.

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

      JqlClauseBuilder createdBetween(String startDateString, String endDateString)
      Adds a condition to the query that finds the issues that where created between the passed dates. This adds the query created >= 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-null startDateString with a null endDateString will add the condition created >= startDateString. Passing a non-null endDateString with a null startDateString will add the condition created <= endDateString. Passing a null startDateString and null endDateString is illegal.

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

      ConditionBuilder created()
      Returns a ConditionBuilder that can be used to build a JQL condition for issue's creation date.
      Returns:
      a reference to a ConditionBuilder for created date.
    • updatedAfter

      JqlClauseBuilder updatedAfter(Date startDate)
      Adds a condition to the query that finds the issues that were updated after the passed date. This adds the query updated >= 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

      JqlClauseBuilder updatedAfter(String startDate)
      Adds a condition to the query that finds the issues that were updated after the passed date. This adds the query updated >= 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

      JqlClauseBuilder updatedBetween(Date startDate, Date endDate)
      Adds a condition to the query that finds the issues that were updated between the passed dates. This adds the query updated >= 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-null startDate with a null endDate will add the condition updated >= startDate. Passing a non-null endDate with a null startDate will add the condition updated <= endDate. Passing a null startDate and null endDate is illegal.

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

      JqlClauseBuilder updatedBetween(String startDateString, String endDateString)
      Adds a condition to the query that finds the issues that were updated between the passed dates. This adds the query updated >= startDateString AND updated <= endDateString to the query being built.

      It is also possible to create an open interval by passing one of the arguments as null. Passing a non-null startDateString with a null endDateString will add the condition updated >= startDateString. Passing a non-null endDateString with a null startDateString will add the condition updated <= endDateString. Passing a null startDateString and null endDateString is illegal.
      Parameters:
      startDateString - the date that issues must be updated on or after. Can be a date (e.g. "2008-10-23") or a period (e.g. "-3w"). May be null if endDateString is not null.
      endDateString - the date that issues must be updated on or before. Can be a date (e.g. "2008-10-23") or a period (e.g. "-3w"). May be null if startDateString is not null.
      Returns:
      a reference to the current builder.
      Throws:
      IllegalStateException - if it is not possible to add a JQL condition given the current state of the builder.
      IllegalArgumentException - if both startDateString and endDateString are null.
    • updated

      ConditionBuilder updated()
      Returns a ConditionBuilder that can be used to build a JQL condition for issue's updated date.
      Returns:
      a reference to a ConditionBuilder for updated date.
    • dueAfter

      JqlClauseBuilder dueAfter(Date startDate)
      Adds a condition to the query that finds the issues that are due after the passed date. This adds the query dueDate >= 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

      JqlClauseBuilder dueAfter(String startDate)
      Adds a condition to the query that finds the issues that are due after the passed date. This adds the query dueDate >= 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

      JqlClauseBuilder dueBetween(Date startDate, Date endDate)
      Adds a condition to the query that finds the issues that were due between the passed dates. This adds the query dueDate >= startDate AND dueDate <= endDate to the query being built.

      It is also possible to create an open interval by passing one of the arguments as null. Passing a non-null startDate with a null endDate will add the condition dueDate >= startDate. Passing a non-null endDate with a null startDate will add the condition dueDate <= endDate. Passing a null startDate and null endDate is illegal.
      Parameters:
      startDate - the date that issues must be due on or after. May be null if endDate is not null.
      endDate - the date that issues must be due on or before. May be null if startDate is not null.
      Returns:
      a reference to the current builder.
      Throws:
      IllegalStateException - if it is not possible to add a JQL condition given the current state of the builder.
      IllegalArgumentException - if both startDate and endDate are null.
    • dueBetween

      JqlClauseBuilder dueBetween(String startDateString, String endDateString)
      Adds a condition to the query that finds the issues that were due between the passed dates. This adds the query dueDate >= startDateString AND dueDate <= endDateString to the query being built.

      It is also possible to create an open interval by passing one of the arguments as null. Passing a non-null startDateString with a null endDateString will add the condition dueDate >= startDateString. Passing a non-null endDateString with a null startDateString will add the condition dueDate <= endDateString. Passing a null startDateString and null endDateString is illegal.
      Parameters:
      startDateString - the date that issues must be due on or after. Can be a date (e.g. "2008-10-23") or a period (e.g. "-3w"). May be null if endDateString is not null.
      endDateString - the date that issues must be due on or before. Can be a date (e.g. "2008-10-23") or a period (e.g. "-3w"). May be null if startDateString is not null.
      Returns:
      a reference to the current builder.
      Throws:
      IllegalStateException - if it is not possible to add a JQL condition given the current state of the builder.
      IllegalArgumentException - if both startDateString and endDateString are null.
    • due

      Returns a ConditionBuilder that can be used to build a JQL condition for issue's due date.
      Returns:
      a reference to a ConditionBuilder for due date.
    • lastViewedAfter

      JqlClauseBuilder 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). This adds the query lastViewed >= 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

      JqlClauseBuilder 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). This adds the query lastViewed >= 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

      JqlClauseBuilder lastViewedBetween(Date startDate, Date endDate)
      Adds a condition to the query that finds the issues that were viewed between the passed dates. This adds the query lastViewed >= startDate AND lastViewed <= endDate to the query being built.

      It is also possible to create an open interval by passing one of the arguments as null. Passing a non-null startDate with a null endDate will add the condition lastViewed >= startDate. Passing a non-null endDate with a null startDate will add the condition lastViewed <= endDate. Passing a null startDate and null endDate is illegal. This will only return issues that are stored in the user's history ~ 50 issues.
      Parameters:
      startDate - the date that issues must be viewed on or after. May be null if endDate is not null.
      endDate - the date that issues must be viewed on or before. May be null if startDate is not null.
      Returns:
      a reference to the current builder.
      Throws:
      IllegalStateException - if it is not possible to add a JQL condition given the current state of the builder.
      IllegalArgumentException - if both startDate and endDate are null.
    • lastViewedBetween

      JqlClauseBuilder lastViewedBetween(String startDateString, String endDateString)
      Adds a condition to the query that finds the issues that were last viewed between the passed dates. This adds the query lastViewed >= startDateString AND lastViewed <= endDateString to the query being built.

      It is also possible to create an open interval by passing one of the arguments as null. Passing a non-null startDateString with a null endDateString will add the condition lastViewed >= startDateString. Passing a non-null endDateString with a null startDateString will add the condition lastViewed <= endDateString. Passing a null startDateString and null endDateString is illegal.
      Parameters:
      startDateString - the date that issues must be last viewed on or after. Can be a date (e.g. "2008-10-23") or a period (e.g. "-3w"). May be null if endDateString is not null.
      endDateString - the date that issues must be last viewed on or before. Can be a date (e.g. "2008-10-23") or a period (e.g. "-3w"). May be null if startDateString is not null.
      Returns:
      a reference to the current builder.
      Throws:
      IllegalStateException - if it is not possible to add a JQL condition given the current state of the builder.
      IllegalArgumentException - if both startDateString and endDateString are null.
    • lastViewed

      ConditionBuilder lastViewed()
      Returns a ConditionBuilder that can be used to build a JQL condition for issue's last viewed date.
      Returns:
      a reference to a ConditionBuilder for last viewed date.
    • resolutionDateAfter

      JqlClauseBuilder resolutionDateAfter(Date startDate)
      Adds a condition to the query that finds the issues that were resolved after the passed date. This adds the query resolutionDate >= 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

      JqlClauseBuilder resolutionDateAfter(String startDate)
      Adds a condition to the query that finds the issues that were resolved after the passed date. This adds the query resolutionDate >= 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

      JqlClauseBuilder resolutionDateBetween(Date startDate, Date endDate)
      Adds a condition to the query that finds the issues that were resolved between the passed dates. This adds the query resolutionDate >= startDate AND resolutiondDate <= endDate to the query being built.

      It is also possible to create an open interval by passing one of the arguments as null. Passing a non-null startDate with a null endDate will add the condition resolutionDate >= startDate. Passing a non-null endDate with a null startDate will add the condition resolutionDate <= endDate. Passing a null startDate and null endDate is illegal.
      Parameters:
      startDate - the date that issues must be resolved on or after. May be null if endDate is not null.
      endDate - the date that issues must be resolved on or before. May be null if startDate is not null.
      Returns:
      a reference to the current builder.
      Throws:
      IllegalStateException - if it is not possible to add a JQL condition given the current state of the builder.
      IllegalArgumentException - if both startDate and endDate are null.
    • resolutionDateBetween

      JqlClauseBuilder resolutionDateBetween(String startDateString, String endDateString)
      Adds a condition to the query that finds the issues that were resolved between the passed dates. This adds the query resolutionDate >= startDateString AND resolutionDate <= endDateString to the query being built.

      It is also possible to create an open interval by passing one of the arguments as null. Passing a non-null startDateString with a null endDateString will add the condition resolutionDate >= startDateString. Passing a non-null endDateString with a null startDateString will add the condition resolutionDate <= endDateString. Passing a null startDateString and null endDateString is illegal.
      Parameters:
      startDateString - the date that issues must be resolved on or after. Can be a date (e.g. "2008-10-23") or a period (e.g. "-3w"). May be null if endDateString is not null.
      endDateString - the date that issues must be resolved on or before. Can be a date (e.g. "2008-10-23") or a period (e.g. "-3w"). May be null if startDateString is not null.
      Returns:
      a reference to the current builder.
      Throws:
      IllegalStateException - if it is not possible to add a JQL condition given the current state of the builder.
      IllegalArgumentException - if both startDateString and endDateString are null.
    • resolutionDate

      ConditionBuilder resolutionDate()
      Returns a ConditionBuilder that can be used to build a JQL condition for issue's resolution date.
      Returns:
      a reference to a ConditionBuilder for resolution date.
    • reporterUser

      JqlClauseBuilder reporterUser(String userName)
      Adds a condition to the query that finds issues that where reported by the passed user. This adds the condition reporter = userName to the query being built.
      Parameters:
      userName - the username to search for. Cannot be null.
      Returns:
      a reference to the current builder.
      Throws:
      IllegalStateException - if it is not possible to add a JQL condition given the current state of the builder.
    • reporterInGroup

      JqlClauseBuilder reporterInGroup(String groupName)
      Adds a condition to the query that finds all issues that were reported by users in a particular group. This adds the condition reporter 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 condition reporter = currentUser() to the query being built.
      Returns:
      a reference to the current builder.
      Throws:
      IllegalStateException - if it is not possible to add a JQL condition given the current state of the builder.
    • reporterIsEmpty

      JqlClauseBuilder reporterIsEmpty()
      Adds a condition to the query to find issues without a reporter. This adds the condition reporter IS EMPTY to the query being built.
      Returns:
      a reference to the current builder.
      Throws:
      IllegalStateException - if it is not possible to add a JQL condition given the current state of the builder.
    • reporter

      ConditionBuilder reporter()
      Returns a ConditionBuilder that can be used to build a JQL condition for the issue's reporter.
      Returns:
      a reference to a ConditionBuilder for reporter.
    • assigneeUser

      JqlClauseBuilder assigneeUser(String userName)
      Adds a condition to the query that finds issues that are assigned to the passed user. This adds the condition assignee = userName to the query being built.
      Parameters:
      userName - the username to search for. Cannot be null.
      Returns:
      a reference to the current builder.
      Throws:
      IllegalStateException - if it is not possible to add a JQL condition given the current state of the builder.
    • assigneeInGroup

      JqlClauseBuilder assigneeInGroup(String groupName)
      Adds a condition to the query that finds all issues that are assigned to users in a particular group. This adds the condition assignee 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 condition assignee = currentUser() to the query being built.
      Returns:
      a reference to the current builder.
      Throws:
      IllegalStateException - if it is not possible to add a JQL condition given the current state of the builder.
    • assigneeIsEmpty

      JqlClauseBuilder assigneeIsEmpty()
      Adds a condition to the query to find all unassigned issues. This adds the condition assignee IS EMPTY to the query being built.
      Returns:
      a reference to the current builder.
      Throws:
      IllegalStateException - if it is not possible to add a JQL condition given the current state of the builder.
    • assignee

      ConditionBuilder assignee()
      Returns a ConditionBuilder that can be used to build a JQL condition for the issue's assignee.
      Returns:
      a reference to a ConditionBuilder for assignee.
    • component

      JqlClauseBuilder component(String... components)
      Add a condition to the query to find all issues with particular components. This adds the JQL condition component in (components) to the query.
      Parameters:
      components - the Jira components to search for. Each component can be specified by its name (e.g. "Web") or by its Jira ID as a string (e.g. "10000"). Must not be null, empty or contain any null values.
      Returns:
      a reference to the current builder.
      Throws:
      IllegalStateException - if it is not possible to add a JQL condition given the current state of the builder.
    • component

      JqlClauseBuilder component(Long... components)
      Adds a condition to the query to find all issues with particular components. This adds the JQL condition component in (components) to the query.
      Parameters:
      components - the ids of the components to search for. Must not be null, contain nulls or be empty.
      Returns:
      a reference to the current builder.
      Throws:
      IllegalStateException - if it is not possible to add a JQL condition given the current state of the builder.
    • componentIsEmpty

      JqlClauseBuilder componentIsEmpty()
      Adds a condition to the query to find all issues that have not component assigned. This adds the JQL condition component 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 a ConditionBuilder that can be used to build a JQL condition for the issue's component.
      Returns:
      a reference to a ConditionBuilder for component.
    • labels

      JqlClauseBuilder labels(String... labels)
      Adds a condition to the query to find all issues with particular labels. This adds the JQL condition labels in (labels) to the query.
      Parameters:
      labels - the labels to search for. Must not be null, contain nulls or be empty.
      Returns:
      a reference to the current builder.
      Throws:
      IllegalStateException - if it is not possible to add a JQL condition given the current state of the builder.
    • labelsIsEmpty

      JqlClauseBuilder labelsIsEmpty()
      Adds a condition to the query to find all issues that have no labels. This adds the JQL condition labels 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

      Returns a ConditionBuilder that can be used to build a JQL condition for the issue's labels.
      Returns:
      a reference to a ConditionBuilder for labels.
    • issue

      JqlClauseBuilder issue(String... keys)
      Adds a condition to the query that will find all issues with the passed key. This adds the JQL condition key IN (keys) to the query.
      Parameters:
      keys - the issues keys to search for. Cannot be null, empty or contain any nulls.
      Returns:
      a reference to the current builder.
      Throws:
      IllegalStateException - if it is not possible to add a JQL condition given the current state of the builder.
    • issueInHistory

      JqlClauseBuilder issueInHistory()
      Adds a condition to the query that will find all issues currently within the user's history. This adds the JQL condition key IN issueHistory() to the query.
      Returns:
      a reference to the current builder.
      Throws:
      IllegalStateException - if it is not possible to add a JQL condition given the current state of the builder.
    • issueInWatchedIssues

      JqlClauseBuilder issueInWatchedIssues()
      Adds a condition to the query that will find all issues currently watched by the user. This adds the JQL condition key IN watchedIssues() to the query.
      Returns:
      a reference to the current builder.
      Throws:
      IllegalStateException - if it is not possible to add a JQL condition given the current state of the builder.
    • issueInVotedIssues

      JqlClauseBuilder issueInVotedIssues()
      Adds a condition to the query that will find all issues the user has voted on. This adds the JQL condition key IN votedIssues() to the query.
      Returns:
      a reference to the current builder.
      Throws:
      IllegalStateException - if it is not possible to add a JQL condition given the current state of the builder.
    • issue

      Returns a ConditionBuilder that can be used to build a JQL condition for the issue's id or key.
      Returns:
      a reference to a ConditionBuilder for issue id or key.
    • issueParent

      JqlClauseBuilder issueParent(String... keys)
      Adds a condition to the query that will find all issues that have the passed issues as parents. This adds the condition parent IN (keys) to the query.
      Parameters:
      keys - the issues keys to search for. Cannot be null, empty or contain any nulls.
      Returns:
      a reference to the current builder.
      Throws:
      IllegalStateException - if it is not possible to add a JQL condition given the current state of the builder.
    • issueParent

      ConditionBuilder issueParent()
      Returns a ConditionBuilder that can be used to build a JQL condition for the issue's parent.
      Returns:
      a reference to a ConditionBuilder for issue parent.
    • currentEstimate

      ConditionBuilder currentEstimate()
      Returns a ConditionBuilder that can be used to build a JQL condition for the issue's current estimate.
      Returns:
      a reference to a ConditionBuilder for current estimate.
    • originalEstimate

      ConditionBuilder originalEstimate()
      Returns a ConditionBuilder that can be used to build a JQL condition for the issue's original estimate.
      Returns:
      a reference to a ConditionBuilder for original estimate.
    • timeSpent

      ConditionBuilder timeSpent()
      Returns a ConditionBuilder that can be used to build a JQL condition for the issue's timeSpent field.
      Returns:
      a reference to a ConditionBuilder for timeSpent.
    • workRatio

      ConditionBuilder workRatio()
      Returns a ConditionBuilder that can be used to build a JQL condition for the issue's work ratio field.
      Returns:
      a reference to a ConditionBuilder for work ratio.
    • level

      JqlClauseBuilder level(String... levels)
      Adds a condition to the query that will find all issues with the passed security levels. This adds the condition level IN (levels) to the query.
      Parameters:
      levels - the security levels to search for. Cannot be null, empty or contain nulls.
      Returns:
      a reference to the current builder.
      Throws:
      IllegalStateException - if it is not possible to add a JQL condition given the current state of the builder.
    • level

      Returns a ConditionBuilder that can be used to build a JQL condition for the issue's security level.
      Returns:
      a reference to a ConditionBuilder for issue level.
    • savedFilter

      JqlClauseBuilder savedFilter(String... filters)
      Adds a condition to the query that will include the results from the passed filters in the search. This adds the condition filter IN (filters) to the condition.
      Parameters:
      filters - the filters to include in the search. They can be specified by the name (e.g. "Jira Unresolved") or by their Jira id (e.g. "10000"). Cannot be null, empty or contain any nulls.
      Returns:
      a reference to the current builder.
      Throws:
      IllegalStateException - if it is not possible to add a JQL condition given the current state of the builder.
    • savedFilter

      ConditionBuilder savedFilter()
      Returns a ConditionBuilder that can be used to add saved filters as conditions to the query.
      Returns:
      a reference to a ConditionBuilder for saved filters.
    • votes

      Returns a ConditionBuilder that can be used to build a JQL condition for the number of votes on an issue.
      Returns:
      a reference to a ConditionBuilder for votes.
    • voterUser

      JqlClauseBuilder voterUser(String userName)
      Adds a condition to the query that finds issues that are voted for by the passed user. This adds the condition voter = userName to the query being built.
      Parameters:
      userName - the username to search for. Cannot be null.
      Returns:
      a reference to the current builder.
      Throws:
      IllegalStateException - if it is not possible to add a JQL condition given the current state of the builder.
    • voterInGroup

      JqlClauseBuilder voterInGroup(String groupName)
      Adds a condition to the query that finds all issues that were voted for by users in a particular group. This adds the condition voter in membersOf("groupName") to the query being built.
      Parameters:
      groupName - the group for the condition. Cannot be null.
      Returns:
      a reference to the current builder.
      Throws:
      IllegalStateException - if it is not possible to add a JQL condition given the current state of the builder.
    • voterIsCurrentUser

      JqlClauseBuilder voterIsCurrentUser()
      Adds a condition to the query that finds all issues that were voted for by the current user. This adds the condition voter = currentUser() to the query being built.
      Returns:
      a reference to the current builder.
      Throws:
      IllegalStateException - if it is not possible to add a JQL condition given the current state of the builder.
    • voterIsEmpty

      JqlClauseBuilder voterIsEmpty()
      Adds a condition to the query to find issues without any votes. This adds the condition voter IS EMPTY to the query being built.
      Returns:
      a reference to the current builder.
      Throws:
      IllegalStateException - if it is not possible to add a JQL condition given the current state of the builder.
    • voter

      Returns a ConditionBuilder 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 a ConditionBuilder that can be used to build a JQL condition for the number of watches on an issue.
      Returns:
      a reference to a ConditionBuilder for votes.
    • watcherUser

      JqlClauseBuilder watcherUser(String userName)
      Adds a condition to the query that finds issues that are watched by the passed user. This adds the condition watcher = userName to the query being built.
      Parameters:
      userName - the username to search for. Cannot be null.
      Returns:
      a reference to the current builder.
      Throws:
      IllegalStateException - if it is not possible to add a JQL condition given the current state of the builder.
    • attachmentsExists

      JqlClauseBuilder attachmentsExists(boolean hasAttachment)
      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

      JqlClauseBuilder watcherInGroup(String groupName)
      Adds a condition to the query that finds all issues that were watched by users in a particular group. This adds the condition watcher in membersOf("groupName") to the query being built.
      Parameters:
      groupName - the group for the condition. Cannot be null.
      Returns:
      a reference to the current builder.
      Throws:
      IllegalStateException - if it is not possible to add a JQL condition given the current state of the builder.
    • watcherIsCurrentUser

      JqlClauseBuilder watcherIsCurrentUser()
      Adds a condition to the query that finds all issues that were watched by the current user. This adds the condition watcher = currentUser() to the query being built.
      Returns:
      a reference to the current builder.
      Throws:
      IllegalStateException - if it is not possible to add a JQL condition given the current state of the builder.
    • watcherIsEmpty

      JqlClauseBuilder watcherIsEmpty()
      Adds a condition to the query to find issues without any watchers. This adds the condition watcher IS EMPTY to the query being built.
      Returns:
      a reference to the current builder.
      Throws:
      IllegalStateException - if it is not possible to add a JQL condition given the current state of the builder.
    • watcher

      ConditionBuilder watcher()
      Returns a ConditionBuilder that can be used to build a JQL condition for the watchers on an issue.
      Returns:
      a reference to a ConditionBuilder for watcher.
    • field

      ConditionBuilder field(String jqlName)
      Returns a ConditionBuilder that can be used to build a JQL condition for the passed name.
      Parameters:
      jqlName - the name of the JQL condition. Cannot be null.
      Returns:
      a reference to a ConditionBuilder for the passed name.
    • customField

      ConditionBuilder customField(Long id)
      Returns a ConditionBuilder that can be used to build a JQL condition for a custom field with the passed id.
      Parameters:
      id - the ID for the custom field. Cannot be null.
      Returns:
      a reference to a ConditionBuilder for the passed ID.
    • addClause

      JqlClauseBuilder addClause(Clause clause)
      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

      JqlClauseBuilder addDateCondition(String clauseName, Operator operator, Date date)
      Adds the JQL condition clauseName operator date to the query being built.
      Parameters:
      clauseName - name of the clause in the condition. Must not be null.
      operator - one of the enumerated Operators. Must not be null.
      date - the date for the condition. Must not be null.
      Returns:
      a reference to the current builder. Never null.
      Throws:
      IllegalStateException - if it is not possible to add a JQL condition given the current state of the builder.
    • addDateCondition

      JqlClauseBuilder addDateCondition(String clauseName, Date... dates)
      Adds the JQL condition clauseName in (dates) to the query being built.
      Parameters:
      clauseName - name of the clause in the condition. Must not be null.
      dates - dates for the condition. Must not be null, empty or contain any null values.
      Returns:
      a reference to the current builder.
      Throws:
      IllegalStateException - if it is not possible to add a JQL condition given the current state of the builder.
    • addDateCondition

      JqlClauseBuilder addDateCondition(String clauseName, Operator operator, Date... dates)
      Adds the JQL condition clauseName operator (clauseValues) to the query being built.
      Parameters:
      clauseName - name of the clause in the condition. Must not be null.
      operator - one of the enumerated Operators. Must not be null.
      dates - date values for the condition. Must not be null, empty or contain any null values.
      Returns:
      a reference to the current builder.
      Throws:
      IllegalStateException - if it is not possible to add a JQL condition given the current state of the builder.
    • addDateCondition

      JqlClauseBuilder addDateCondition(String clauseName, Collection<Date> dates)
      Adds the JQL condition clauseName in (dates) to the query being built.
      Parameters:
      clauseName - name of the clause in the condition. Must not be null.
      dates - dates for the condition. Must not be null, empty or contain any null values.
      Returns:
      a reference to the current builder.
      Throws:
      IllegalStateException - if it is not possible to add a JQL condition given the current state of the builder.
    • addDateCondition

      JqlClauseBuilder addDateCondition(String clauseName, Operator operator, Collection<Date> dates)
      Adds the JQL condition clauseName operator (clauseValues) to the query being built.
      Parameters:
      clauseName - name of the clause in the condition. Must not be null.
      operator - one of the enumerated Operators. Must not be null.
      dates - date values for the condition. Must not be null, empty or contain any null values.
      Returns:
      a reference to the current builder.
      Throws:
      IllegalStateException - if it is not possible to add a JQL condition given the current state of the builder.
    • addDateRangeCondition

      JqlClauseBuilder addDateRangeCondition(String clauseName, Date startDate, Date endDate)
      Adds a condition range condition to the current query for the passed dates. This adds the query clauseName >= startDate AND clauseName <= endDate to the query being built.

      It is also possible to create an open interval by passing one of the arguments as null. Passing a non-null startDate with a null endDate will add the condition clauseName >= startDate. Passing a non-null endDate with a null startDate will add the condition clauseName <= endDate. Passing a null startDate and null endDate is illegal.
      Parameters:
      clauseName - name of the clause in the condition. Must not be null.
      startDate - the date for the start of the range. May be null if endDate is not null.
      endDate - the date for the end of the range. May be null if startDate is not null.
      Returns:
      a reference to the current builder.
      Throws:
      IllegalStateException - if it is not possible to add a JQL condition given the current state of the builder.
      IllegalArgumentException - if both startDate and endDate are null.
    • addFunctionCondition

      JqlClauseBuilder addFunctionCondition(String clauseName, String functionName)
      Adds the JQL condition clauseName = functionName() to the query being built.
      Parameters:
      clauseName - name of the clause in the condition. Must not be null.
      functionName - name of the function to call. Must not be null.
      Returns:
      a reference to the current builder. Never null.
      Throws:
      IllegalStateException - if it is not possible to add a JQL condition given the current state of the builder.
    • addFunctionCondition

      JqlClauseBuilder addFunctionCondition(String clauseName, String functionName, String... args)
      Adds the JQL condition clauseName = functionName(arg1, arg2, arg3, ..., argN) to the query being built.
      Parameters:
      clauseName - name of the clause in the condition. Must not be null.
      functionName - name of the function to call. Must not be null.
      args - the arguments to add to the function. Must not be null or contain any null values.
      Returns:
      a reference to the current builder. Never null.
      Throws:
      IllegalStateException - if it is not possible to add a JQL condition given the current state of the builder.
    • addFunctionCondition

      JqlClauseBuilder addFunctionCondition(String clauseName, String functionName, Collection<String> args)
      Adds the JQL condition clauseName = functionName(arg1, arg2, arg3, ..., argN) to the query being built.
      Parameters:
      clauseName - name of the clause in the condition. Must not be null.
      functionName - name of the function to call. Must not be null.
      args - the arguments to add to the function. Must not be null or contain any null values.
      Returns:
      a reference to the current builder. Never null.
      Throws:
      IllegalStateException - if it is not possible to add a JQL condition given the current state of the builder.
    • addFunctionCondition

      JqlClauseBuilder addFunctionCondition(String clauseName, Operator operator, String functionName)
      Adds the JQL condition clauseName operator functionName() to the query being built.
      Parameters:
      clauseName - name of the clause in the condition. Must not be null.
      operator - one of the enumerated Operators. Must not be null.
      functionName - name of the function to call. Must not be null.
      Returns:
      a reference to the current builder. Never null.
      Throws:
      IllegalStateException - if it is not possible to add a JQL condition given the current state of the builder.
    • addFunctionCondition

      JqlClauseBuilder addFunctionCondition(String clauseName, Operator operator, String functionName, String... args)
      Adds the JQL condition clauseName operator functionName(arg1, arg2, arg3, ..., argN) to the query being built.
      Parameters:
      clauseName - name of the clause in the condition. Must not be null.
      operator - one of the enumerated Operators. Must not be null.
      functionName - name of the function to call. Must not be null.
      args - the arguments to add to the function. Must not be null or contain any null values.
      Returns:
      a reference to the current builder. Never null.
      Throws:
      IllegalStateException - if it is not possible to add a JQL condition given the current state of the builder.
    • addFunctionCondition

      JqlClauseBuilder addFunctionCondition(String clauseName, Operator operator, String functionName, Collection<String> args)
      Adds the JQL condition clauseName operator functionName(arg1, arg2, arg3, ..., argN) to the query being built.
      Parameters:
      clauseName - name of the clause in the condition. Must not be null.
      operator - one of the enumerated Operators. Must not be null.
      functionName - name of the function to call. Must not be null.
      args - the arguments to add to the function. Must not be null or contain any null values.
      Returns:
      a reference to the current builder. Never null.
      Throws:
      IllegalStateException - if it is not possible to add a JQL condition given the current state of the builder.
    • addStringCondition

      JqlClauseBuilder addStringCondition(String clauseName, String clauseValue)
      Adds the JQL condition clauseName = "clauseValue" to the query being built.
      Parameters:
      clauseName - name of the clause in the condition. Must not be null.
      clauseValue - string value for the condition. Must not be null.
      Returns:
      a reference to the current builder. Never null.
      Throws:
      IllegalStateException - if it is not possible to add a JQL condition given the current state of the builder.
    • addStringCondition

      JqlClauseBuilder addStringCondition(String clauseName, String... clauseValues)
      Adds the JQL condition clauseName in (clauseValues) to the query being built.
      Parameters:
      clauseName - name of the clause in the condition. Must not be null.
      clauseValues - string values for the condition. Must not be null, empty or contain any null values.
      Returns:
      a reference to the current builder.
      Throws:
      IllegalStateException - if it is not possible to add a JQL condition given the current state of the builder.
    • addStringCondition

      JqlClauseBuilder addStringCondition(String clauseName, Collection<String> clauseValues)
      Adds the JQL condition clauseName in (clauseValues) to the query being built.
      Parameters:
      clauseName - name of the clause in the condition. Must not be null.
      clauseValues - string values for the condition. Must not be null, empty or contain any null values.
      Returns:
      a reference to the current builder.
      Throws:
      IllegalStateException - if it is not possible to add a JQL condition given the current state of the builder.
    • addFieldReferenceCondition

      JqlClauseBuilder addFieldReferenceCondition(JqlFieldReference ref, Collection<String> clauseValues)
      Adds the JQL condition clauseName in (clauseValues) in form of field reference to the query being built.
      Parameters:
      ref - a JqlFieldReference to describe completed custom field reference
      clauseValues - string values for the condition. Must not be null, empty or contain any null values.
      Returns:
      a reference to the current builder.
    • addStringCondition

      JqlClauseBuilder addStringCondition(String clauseName, Operator operator, String clauseValue)
      Adds the JQL condition clauseName operator "clauseValue" to the query being built.
      Parameters:
      clauseName - name of the clause in the condition. Must not be null.
      operator - one of the enumerated Operators. Must not be null.
      clauseValue - string value for the condition. Must not be null.
      Returns:
      a reference to the current builder.
      Throws:
      IllegalStateException - if it is not possible to add a JQL condition given the current state of the builder.
    • addStringCondition

      JqlClauseBuilder addStringCondition(String clauseName, Operator operator, String... clauseValues)
      Adds the JQL condition clauseName operator (clauseValues) to the query being built.
      Parameters:
      clauseName - name of the clause in the condition. Must not be null.
      operator - one of the enumerated Operators. Must not be null.
      clauseValues - string values for the condition. Must not be null, empty or contain any null values.
      Returns:
      a reference to the current builder.
      Throws:
      IllegalStateException - if it is not possible to add a JQL condition given the current state of the builder.
    • addStringCondition

      JqlClauseBuilder addStringCondition(String clauseName, Operator operator, Collection<String> clauseValues)
      Adds the JQL condition clauseName operator (clauseValues) to the query being built.
      Parameters:
      clauseName - name of the clause in the condition. Must not be null.
      operator - one of the enumerated Operators. Must not be null.
      clauseValues - string values for the condition. Must not be null, empty or contain any null values.
      Returns:
      a reference to the current builder.
      Throws:
      IllegalStateException - if it is not possible to add a JQL condition given the current state of the builder.
    • addStringRangeCondition

      JqlClauseBuilder addStringRangeCondition(String clauseName, String start, String end)
      Adds a condition range condition to the current query for the passed values. This adds the query clauseName >= start AND clauseName <= end to the query being built.

      It is also possible to create an open interval by passing one of the arguments as null. Passing a non-null start with a null end will add the condition clauseName >= start. Passing a non-null end with a null start will add the condition clauseName <= end. Passing a null start and null end is illegal.
      Parameters:
      clauseName - name of the clause in the condition. Must not be null.
      start - the start of the range. May be null if end is not null.
      end - the end of the range. May be null if start is not null.
      Returns:
      a reference to the current builder.
      Throws:
      IllegalStateException - if it is not possible to add a JQL condition given the current state of the builder.
      IllegalArgumentException - if both start and end are null.
    • addNumberCondition

      JqlClauseBuilder addNumberCondition(String clauseName, Long clauseValue)
      Adds the JQL condition clauseName = clauseValue to the query being built.
      Parameters:
      clauseName - name of the clause in the condition. Must not be null.
      clauseValue - long value for the condition. Must not be null.
      Returns:
      a reference to the current builder.
      Throws:
      IllegalStateException - if it is not possible to add a JQL condition given the current state of the builder.
    • addNumberCondition

      JqlClauseBuilder addNumberCondition(String clauseName, Long... clauseValues)
      Adds the JQL condition clauseName in (clauseValues) to the query being built.
      Parameters:
      clauseName - name of the clause in the condition. Must not be null.
      clauseValues - long values. Must not be null, empty or contain any null values.
      Returns:
      a reference to the current builder.
      Throws:
      IllegalStateException - if it is not possible to add a JQL condition given the current state of the builder.
    • addNumberCondition

      JqlClauseBuilder addNumberCondition(String clauseName, Collection<Long> clauseValues)
      Adds the JQL condition clauseName in (clauseValues) to the query being built.
      Parameters:
      clauseName - name of the clause in the condition. Must not be null.
      clauseValues - long values for the condition. Must not be null, empty or contain any null values.
      Returns:
      a reference to the current builder.
      Throws:
      IllegalStateException - if it is not possible to add a JQL condition given the current state of the builder.
    • addNumberCondition

      JqlClauseBuilder addNumberCondition(String clauseName, Operator operator, Long clauseValue)
      Adds the JQL condition clauseName operator clauseValue to the query being built.
      Parameters:
      clauseName - name of the clause in the condition. Must not be null.
      operator - one of the enumerated Operators. Must not be null.
      clauseValue - long value for the condition. Must not be null.
      Returns:
      a reference to the current builder.
      Throws:
      IllegalStateException - if it is not possible to add a JQL condition given the current state of the builder.
    • addNumberCondition

      JqlClauseBuilder addNumberCondition(String clauseName, Operator operator, Long... clauseValues)
      Adds the JQL condition clauseName operator (clauseValues) to the query being built.
      Parameters:
      clauseName - name of the clause in the condition. Must not be null.
      operator - one of the enumerated Operators. Must not be null.
      clauseValues - long values for the condition. Must not be null, empty or contain any null values.
      Returns:
      a reference to the current builder.
      Throws:
      IllegalStateException - if it is not possible to add a JQL condition given the current state of the builder.
    • addNumberCondition

      JqlClauseBuilder addNumberCondition(String clauseName, Operator operator, Collection<Long> clauseValues)
      Add the JQL condition clauseName operator (clauseValues) to the query being built.
      Parameters:
      clauseName - name of the clause in the condition. Must not be null.
      operator - one of the enumerated Operators. Must not be null.
      clauseValues - long values for the condition. Must not be null, empty or contain any null values.
      Returns:
      a reference to the current builder.
      Throws:
      IllegalStateException - if it is not possible to add a JQL condition given the current state of the builder.
    • addNumberRangeCondition

      JqlClauseBuilder addNumberRangeCondition(String clauseName, Long start, Long end)
      Adds a condition range condition to the current query for the passed values. This adds the query clauseName >= start AND clauseName <= end to the query being built.

      It is also possible to create an open interval by passing one of the arguments as null. Passing a non-null start with a null end will add the condition clauseName >= start. Passing a non-null end with a null start will add the condition clauseName <= end. Passing a null start and null end is illegal.
      Parameters:
      clauseName - name of the clause in the condition. Must not be null.
      start - the start of the range. May be null if end is not null.
      end - the end of the range. May be null if start is not null.
      Returns:
      a reference to the current builder.
      Throws:
      IllegalStateException - if it is not possible to add a JQL condition given the current state of the builder.
      IllegalArgumentException - if both start and end are null.
    • addCondition

      ConditionBuilder addCondition(String clauseName)
      Returns a ConditionBuilder that can be used to build a JQL condition for the passed JQL name.
      Parameters:
      clauseName - the name of the JQL condition to add.
      Returns:
      a reference to a condition builder for the passed condition.
    • addCondition

      JqlClauseBuilder addCondition(String clauseName, Operand operand)
      Adds the JQL condition clauseName = operand to the query being built.
      Parameters:
      clauseName - name of the clause in the condition. Must not be null.
      operand - defines an operand that will serve as the clause value. Must not be null.
      Returns:
      a reference to the current builder.
      Throws:
      IllegalStateException - if it is not possible to add a JQL condition given the current state of the builder.
    • addCondition

      JqlClauseBuilder addCondition(String clauseName, Operand... operands)
      Adds the JQL condition clauseName in (operands) to the query being built.
      Parameters:
      clauseName - name of the clause in the condition. Must not be null.
      operands - operands values for the condition. Must not be null, empty or contain any null values.
      Returns:
      a reference to the current builder.
      Throws:
      IllegalStateException - if it is not possible to add a JQL condition given the current state of the builder.
    • addCondition

      JqlClauseBuilder addCondition(String clauseName, Collection<? extends Operand> operands)
      Add the JQL condition clauseName in (operands) to the query being built.
      Parameters:
      clauseName - name of the clause in the condition. Must not be null.
      operands - operands values for the condition. Must not be null, empty or contain any null values.
      Returns:
      a reference to the current builder.
      Throws:
      IllegalStateException - if it is not possible to add a JQL condition given the current state of the builder.
    • addCondition

      JqlClauseBuilder addCondition(String clauseName, Operator operator, Operand operand)
      Adds the JQL condition clauseName operator operand to the query being built.
      Parameters:
      clauseName - name of the clause in the condition. Must not be null.
      operator - one of the enumerated Operators. Must not be null.
      operand - defines an operand that will serve as the clause value. Must not be null.
      Returns:
      a reference to the current builder.
      Throws:
      IllegalStateException - if it is not possible to add a JQL condition given the current state of the builder.
    • addCondition

      JqlClauseBuilder addCondition(String clauseName, Operator operator, Operand... operands)
      Adds the JQL condition clauseName operator (operands) to the query being built.
      Parameters:
      clauseName - name of the clause in the condition. Must not be null.
      operator - one of the enumerated Operators. Must not be null.
      operands - values for the condition. Must not be null, empty or contain any null values.
      Returns:
      a reference to the current builder.
      Throws:
      IllegalStateException - if it is not possible to add a JQL condition given the current state of the builder.
    • addCondition

      JqlClauseBuilder addCondition(String clauseName, Operator operator, Collection<? extends Operand> operands)
      Adds the JQL condition clauseName operator (operands) to the query being built.
      Parameters:
      clauseName - name of the clause in the condition. Must not be null.
      operator - one of the enumerated Operators. Must not be null.
      operands - values for the condition. Must not be null, empty or contain any null values.
      Returns:
      a reference to the current builder.
      Throws:
      IllegalStateException - if it is not possible to add a JQL condition given the current state of the builder.
    • addRangeCondition

      JqlClauseBuilder addRangeCondition(String clauseName, Operand start, Operand end)
      Adds a condition range condition to the current query for the passed values. This adds the query clauseName >= start AND clauseName <= end to the query being built.

      It is also possible to create an open interval by passing one of the arguments as null. Passing a non-null start with a null end will add the condition clauseName >= start. Passing a non-null end with a null start will add the condition clauseName <= end. Passing a null start and null end is illegal.
      Parameters:
      clauseName - name of the clause in the condition. Must not be null.
      start - the start of the range. May be null if end is not null.
      end - the end of the range. May be null if start is not null.
      Returns:
      a reference to the current builder.
      Throws:
      IllegalStateException - if it is not possible to add a JQL condition given the current state of the builder.
      IllegalArgumentException - if both start and end are null.
    • addEmptyCondition

      JqlClauseBuilder addEmptyCondition(String clauseName)
      Adds an "IS EMPTY" condition to the current query for the passed JQL clause. This adds the query clauseName IS EMPTY to the query being built.
      Parameters:
      clauseName - the clause name for the new condition. Cannot be null.
      Returns:
      a reference to the current builder.
      Throws:
      IllegalStateException - if it is not possible to add a JQL condition given the current state of the builder.
    • 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.