Class DefaultJqlQueryTransformer

java.lang.Object
com.atlassian.jira.jql.util.DefaultJqlQueryTransformer
All Implemented Interfaces:
JqlQueryTransformer

public class DefaultJqlQueryTransformer extends Object implements JqlQueryTransformer
  • Constructor Details

  • Method Details

    • transformNamesToIds

      public Query transformNamesToIds(Query query)
      Description copied from interface: JqlQueryTransformer
      Returns a Query object whose fields names are replaced by fields ids. Fields which will be transformed are Custom Fields and Issue Types. To generate a JQL string representation, use JqlStringSupport.generateJqlString(Query query) instead of Query.getQueryString().

      If the field's name in the query corresponds to more than one field, it will be replaced by all the corresponding IDs connected by an OR clause. For example, for the name 'Version' which is shared by custom fields {'cf[10000]', 'cf[10001]'}, the input query 'Version = 8.15' will result in the following output query: 'cf[10000] = 8.15 OR cf[10001] = 8.15'

      Specified by:
      transformNamesToIds in interface JqlQueryTransformer
      Parameters:
      query - a query to be transformed
      Returns:
      a transformed query with names replaced by ids
    • transformNamesToIds

      public Query transformNamesToIds(String query) throws JqlParseException
      Description copied from interface: JqlQueryTransformer
      Returns a Query object whose fields names are replaced by fields ids. Fields which will be transformed are Custom Fields and Issue Types. To generate a JQL string representation, use JqlStringSupport.generateJqlString(Query query) instead of Query.getQueryString().

      If the field's name in the query corresponds to more than one field, it will be replaced by all the corresponding IDs connected by an OR clause. For example, for the name 'Version' which is shared by custom fields {'cf[10000]', 'cf[10001]'}, the input query 'Version = 8.15' will result in the following output query: 'cf[10000] = 8.15 OR cf[10001] = 8.15'

      Specified by:
      transformNamesToIds in interface JqlQueryTransformer
      Parameters:
      query - a string query to be transformed
      Returns:
      a transformed query with names replaced by ids
      Throws:
      JqlParseException - if an error occurs while parsing the query.
    • transformIdsToNames

      public Query transformIdsToNames(Query query)
      Description copied from interface: JqlQueryTransformer
      Returns a Query object whose fields ids are replaced by fields names. If the name of a field is ambiguous the identifier won't be replaced.

      A name is ambiguous when two or more fields have the same name but different ids, for example, for fields whose name is 'Version' and ids are {'cf[10020]', 'cf[10030]'}, the input query 'cf[10020] = 8.13 OR cf[10030] = 8.16' will result in the same output query.

      Fields which will be transformed are Custom Fields and Issue Types. To generate a JQL string representation, use JqlStringSupport.generateJqlString(Query query) instead of Query.getQueryString().

      Specified by:
      transformIdsToNames in interface JqlQueryTransformer
      Parameters:
      query - a query to be transformed
      Returns:
      a transformed query with ids replaced by names
    • transformIdsToNames

      public Query transformIdsToNames(String query) throws JqlParseException
      Description copied from interface: JqlQueryTransformer
      Returns a Query object whose fields ids are replaced by fields names. If the name of a field is ambiguous the identifier won't be replaced.

      A name is ambiguous when two or more fields have the same name but different ids, for example, for fields whose name is 'Version' and ids are {'cf[10020]', 'cf[10030]'}, the input query 'cf[10020] = 8.13 OR cf[10030] = 8.16' will result in the same output query.

      Fields which will be transformed are Custom Fields and Issue Types. To generate a JQL string representation, use JqlStringSupport.generateJqlString(Query query) instead of Query.getQueryString().

      Specified by:
      transformIdsToNames in interface JqlQueryTransformer
      Parameters:
      query - a string query to be transformed
      Returns:
      a transformed query with ids replaced by names
      Throws:
      JqlParseException - if an error occurs while parsing the query.