Workitem¶
-
class
rtcclient.workitem.
Workitem
(url, rtc_obj, workitem_id=None, raw_data=None)[source]¶ A wrapped class for managing all related resources of the workitem
Parameters: - url – the workitem url
- rtc_obj – a reference to the
rtcclient.client.RTCClient
object - workitem_id – (default is None) the id of the workitem, which will be retrieved if not specified
- raw_data – the raw data ( OrderedDict ) of the request response
-
addAttachment
(filepath)[source]¶ Upload attachment to a workitem
Parameters: filepath – the attachment file path Returns: the rtcclient.models.Attachment
objectReturn type: rtcclient.models.Attachment
-
addChild
(child_id)[source]¶ Add a child to current workitem
Parameters: child_id – the child workitem id/number (integer or equivalent string)
-
addChildren
(child_ids)[source]¶ Add children to current workitem
Parameters: child_ids – a list
contains the children workitem id/number (integer or equivalent string)
-
addComment
(msg=None)[source]¶ Add a comment to this workitem
Parameters: msg – comment message Returns: the rtcclient.models.Comment
objectReturn type: rtcclient.models.Comment
-
addParent
(parent_id)[source]¶ Add a parent to current workitem
Notice: for a certain workitem, no more than one parent workitem can be added and specified
Parameters: parent_id – the parent workitem id/number (integer or equivalent string)
-
addSubscriber
(email)[source]¶ Add a subscriber to this workitem
If the subscriber has already been added, no more actions will be performed.
Parameters: email – the subscriber’s email
-
addSubscribers
(emails_list)[source]¶ Add subscribers to this workitem
If the subscribers have already been added, no more actions will be performed.
Parameters: emails_list – a list
/tuple
/set
contains the the subscribers’ emails
-
getAction
(action_name)[source]¶ Get the
rtcclient.models.Action
object by its nameParameters: action_name – the name/title of the action Returns: the rtcclient.models.Action
objectReturn type: rtcclient.models.Action
-
getActions
()[source]¶ Get all
rtcclient.models.Action
objects of this workitemReturns: a list
contains all thertcclient.models.Action
objectsReturn type: list
-
getAttachments
()[source]¶ Get all
rtcclient.models.Attachment
objects of this workitemReturns: a list
contains all thertcclient.models.Attachment
objectsReturn type: list
-
getChangeSets
()[source]¶ Get all the ChangeSets of this workitem
Returns: a list
contains all thertcclient.models.ChangeSet
objectsReturn type: list
-
getChildren
(returned_properties=None)[source]¶ Get all the children workitems of this workitem
If no children, None will be returned.
Parameters: returned_properties – the returned properties that you want. Refer to rtcclient.client.RTCClient
for more explanationsReturns: a rtcclient.workitem.Workitem
objectReturn type: rtcclient.workitem.Workitem
-
getCommentByID
(comment_id)[source]¶ Get the
rtcclient.models.Comment
object by its idNote: the comment id starts from 0
Parameters: comment_id – the comment id (integer or equivalent string) Returns: the rtcclient.models.Comment
objectReturn type: rtcclient.models.Comment
-
getComments
()[source]¶ Get all
rtcclient.models.Comment
objects in this workitemReturns: a list
contains all thertcclient.models.Comment
objectsReturn type: list
-
getIncludedInBuilds
()[source]¶ Get all
rtcclient.models.IncludedInBuild
objects that have already included this workitemWARNING: If one of the IncludedInBuilds is removed or cannot be retrieved/found correctly, then 404 error will be raised.
Returns: a list
contains all thertcclient.models.IncludedInBuild
objectsReturn type: list
-
getParent
(returned_properties=None)[source]¶ Get the parent workitem of this workitem
If no parent, None will be returned.
Parameters: returned_properties – the returned properties that you want. Refer to rtcclient.client.RTCClient
for more explanationsReturns: a rtcclient.workitem.Workitem
objectReturn type: rtcclient.workitem.Workitem
-
getStates
()[source]¶ Get all
rtcclient.models.State
objects of this workitemReturns: a list
contains all thertcclient.models.State
objectsReturn type: list
-
getSubscribers
()[source]¶ Get subscribers of this workitem
Returns: a list
contains all thertcclient.models.Member
objectsReturn type: list
-
removeChild
(child_id)[source]¶ Remove a child from current workitem
Parameters: child_id – the child workitem id/number (integer or equivalent string)
-
removeChildren
(child_ids)[source]¶ Remove children from current workitem
Parameters: child_ids – a list
contains the children workitem id/number (integer or equivalent string)
-
removeParent
()[source]¶ Remove the parent workitem from current workitem
Notice: for a certain workitem, no more than one parent workitem can be added and specified