Workitem¶
- class rtcclient.workitem.Workitem(url, rtc_obj, workitem_id=None, raw_data=None, skip_full_attributes=True, **kwargs)[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
objectworkitem_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
object- Return 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
object- Return type:
- 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.
- getAction(action_name)[source]¶
Get the
rtcclient.models.Action
object by its name- Parameters:
action_name – the name/title of the action
- Returns:
the
rtcclient.models.Action
object- Return type:
- getActions()[source]¶
Get all
rtcclient.models.Action
objects of this workitem- Returns:
a
list
contains all thertcclient.models.Action
objects- Return type:
- getChangeSets()[source]¶
Get all the ChangeSets of this workitem
- Returns:
a
list
contains all thertcclient.models.ChangeSet
objects- Return type:
- 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 explanations- Returns:
a
rtcclient.workitem.Workitem
object- Return type:
- 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
object- Return type:
- getComments()[source]¶
Get all
rtcclient.models.Comment
objects in this workitem- Returns:
a
list
contains all thertcclient.models.Comment
objects- Return type:
- 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
objects- Return type:
- 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 explanations- Returns:
a
rtcclient.workitem.Workitem
object- Return type:
- getStates()[source]¶
Get all
rtcclient.models.State
objects of this workitem- Returns:
a
list
contains all thertcclient.models.State
objects- Return type:
- getSubscribers()[source]¶
Get subscribers of this workitem
- Returns:
a
list
contains all thertcclient.models.Member
objects- Return type:
- 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