Class DefaultJqlQueryTransformer
- All Implemented Interfaces:
JqlQueryTransformer
-
Constructor Summary
ConstructorsConstructorDescriptionDefaultJqlQueryTransformer(CustomFieldManager customFieldManager, ConstantsManager constantsManager, JqlQueryParser jqlQueryParser, FieldManager fieldManager) -
Method Summary
Modifier and TypeMethodDescriptiontransformIdsToNames(Query query) Returns a Query object whose fields ids are replaced by fields names.transformIdsToNames(String query) Returns a Query object whose fields ids are replaced by fields names.transformNamesToIds(Query query) Returns a Query object whose fields names are replaced by fields ids.transformNamesToIds(String query) Returns a Query object whose fields names are replaced by fields ids.
-
Constructor Details
-
DefaultJqlQueryTransformer
public DefaultJqlQueryTransformer(CustomFieldManager customFieldManager, ConstantsManager constantsManager, JqlQueryParser jqlQueryParser, FieldManager fieldManager)
-
-
Method Details
-
transformNamesToIds
Description copied from interface:JqlQueryTransformerReturns 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, useJqlStringSupport.generateJqlString(Query query)instead ofQuery.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:
transformNamesToIdsin interfaceJqlQueryTransformer- Parameters:
query- a query to be transformed- Returns:
- a transformed query with names replaced by ids
-
transformNamesToIds
Description copied from interface:JqlQueryTransformerReturns 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, useJqlStringSupport.generateJqlString(Query query)instead ofQuery.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:
transformNamesToIdsin interfaceJqlQueryTransformer- 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
Description copied from interface:JqlQueryTransformerReturns 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 ofQuery.getQueryString().- Specified by:
transformIdsToNamesin interfaceJqlQueryTransformer- Parameters:
query- a query to be transformed- Returns:
- a transformed query with ids replaced by names
-
transformIdsToNames
Description copied from interface:JqlQueryTransformerReturns 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 ofQuery.getQueryString().- Specified by:
transformIdsToNamesin interfaceJqlQueryTransformer- 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.
-