Query

class rtcclient.query.Query(rtc_obj)[source]

A wrapped class to perform all query-related actions

Parameters:rtc_obj – a reference to the rtcclient.client.RTCClient object
getAllSavedQueries(projectarea_id=None, projectarea_name=None, creator=None, saved_query_name=None)[source]

Get all saved queries created by somebody (optional) in a certain project area (optional, either projectarea_id or projectarea_name is needed if specified)

If saved_query_name is specified, only the saved queries match the name will be fetched.

Note: only if creator is added as a member, the saved queries can be found. Otherwise None will be returned.

WARNING: now the RTC server cannot correctly list all the saved queries It seems to be a bug of RTC. Recommend using runSavedQueryByUrl to query all the workitems if the query is saved.

Note: It will run faster when more attributes are specified.

Parameters:
Returns:

a list that contains the saved queried rtcclient.models.SavedQuery objects

Return type:

list

getMySavedQueries(projectarea_id=None, projectarea_name=None, saved_query_name=None)[source]

Get all saved queries created by me in a certain project area (optional, either projectarea_id or projectarea_name is needed if specified)

Note: only if myself is added as a member, the saved queries can be found. Otherwise None will be returned.

WARNING: now the RTC server cannot correctly list all the saved queries It seems to be a bug of RTC. Recommend using runSavedQueryByUrl to query all the workitems if the query is saved.

Parameters:
Returns:

a list that contains the saved queried rtcclient.models.SavedQuery objects

Return type:

list

getSavedQueriesByName(saved_query_name, projectarea_id=None, projectarea_name=None, creator=None)[source]

Get all saved queries match the name created by somebody (optional) in a certain project area (optional, either projectarea_id or projectarea_name is needed if specified)

Note: only if creator is added as a member, the saved queries can be found. Otherwise None will be returned.

WARNING: now the RTC server cannot correctly list all the saved queries It seems to be a bug of RTC. Recommend using runSavedQueryByUrl to query all the workitems if the query is saved.

Parameters:
Returns:

a list that contains the saved queried rtcclient.models.SavedQuery objects

Return type:

list

queryWorkitems(query_str, projectarea_id=None, projectarea_name=None, returned_properties=None, archived=False)[source]

Query workitems with the query string in a certain rtcclient.project_area.ProjectArea

At least either of projectarea_id and projectarea_name is given

Parameters:
Returns:

a list that contains the queried rtcclient.workitem.Workitem objects

Return type:

list

runSavedQuery(saved_query_obj, returned_properties=None)[source]

Query workitems using the rtcclient.models.SavedQuery object

Parameters:
  • saved_query_obj – the rtcclient.models.SavedQuery object
  • returned_properties – the returned properties that you want. Refer to rtcclient.client.RTCClient for more explanations
Returns:

a list that contains the queried rtcclient.workitem.Workitem objects

Return type:

list

runSavedQueryByUrl(saved_query_url, returned_properties=None)[source]

Query workitems using the saved query url

Parameters:
  • saved_query_url – the saved query url
  • returned_properties – the returned properties that you want. Refer to rtcclient.client.RTCClient for more explanations
Returns:

a list that contains the queried rtcclient.workitem.Workitem objects

Return type:

list