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: - projectarea_id – the
rtcclient.project_area.ProjectArea
id - projectarea_name – the
rtcclient.project_area.ProjectArea
name - creator – the creator email address
- saved_query_name – the saved query name
Returns: a
list
that contains the saved queriedrtcclient.models.SavedQuery
objectsReturn type: - projectarea_id – the
-
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: - projectarea_id – the
rtcclient.project_area.ProjectArea
id - projectarea_name – the
rtcclient.project_area.ProjectArea
name - saved_query_name – the saved query name
Returns: a
list
that contains the saved queriedrtcclient.models.SavedQuery
objectsReturn type: - projectarea_id – the
-
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: - saved_query_name – the saved query name
- projectarea_id – the
rtcclient.project_area.ProjectArea
id - projectarea_name – the
rtcclient.project_area.ProjectArea
name - creator – the creator email address
Returns: a
list
that contains the saved queriedrtcclient.models.SavedQuery
objectsReturn type:
-
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: - query_str – a valid query string
- projectarea_id – the
rtcclient.project_area.ProjectArea
id - projectarea_name – the
rtcclient.project_area.ProjectArea
name - returned_properties – the returned properties that you want.
Refer to
rtcclient.client.RTCClient
for more explanations - (default is False) (archived) – whether the
rtcclient.workitem.Workitem
is archived
Returns: a
list
that contains the queriedrtcclient.workitem.Workitem
objectsReturn type:
-
runSavedQuery
(saved_query_obj, returned_properties=None)[source]¶ Query workitems using the
rtcclient.models.SavedQuery
objectParameters: - 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 queriedrtcclient.workitem.Workitem
objectsReturn type: - saved_query_obj – the
-
runSavedQueryByID
(saved_query_id, returned_properties=None)[source]¶ Query workitems using the saved query id
This saved query id can be obtained by below two methods:
1.
rtcclient.models.SavedQuery
object (e.g. mysavedquery.id)2. your saved query url (e.g. https://myrtc:9443/jazz/web/xxx#action=xxxx%id=_mGYe0CWgEeGofp83pg), where the last “_mGYe0CWgEeGofp83pg” is the saved query id.
Parameters: - saved_query_id – the saved query id
- returned_properties – the returned properties that you want.
Refer to
rtcclient.client.RTCClient
for more explanations
Returns: a
list
that contains the queriedrtcclient.workitem.Workitem
objectsReturn type:
-
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 queriedrtcclient.workitem.Workitem
objectsReturn type:
-