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 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 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:

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 name

Parameters:

action_name – the name/title of the action

Returns:

the rtcclient.models.Action object

Return type:

rtcclient.models.Action

getActions()[source]

Get all rtcclient.models.Action objects of this workitem

Returns:

a list contains all the rtcclient.models.Action objects

Return type:

list

getAttachments()[source]

Get all rtcclient.models.Attachment objects of this workitem

Returns:

a list contains all the rtcclient.models.Attachment objects

Return type:

list

getChangeSets()[source]

Get all the ChangeSets of this workitem

Returns:

a list contains all the rtcclient.models.ChangeSet objects

Return 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 explanations

Returns:

a rtcclient.workitem.Workitem object

Return type:

rtcclient.workitem.Workitem

getCommentByID(comment_id)[source]

Get the rtcclient.models.Comment object by its id

Note: the comment id starts from 0

Parameters:

comment_id – the comment id (integer or equivalent string)

Returns:

the rtcclient.models.Comment object

Return type:

rtcclient.models.Comment

getComments()[source]

Get all rtcclient.models.Comment objects in this workitem

Returns:

a list contains all the rtcclient.models.Comment objects

Return type:

list

getIncludedInBuilds()[source]

Get all rtcclient.models.IncludedInBuild objects that have already included this workitem

WARNING: If one of the IncludedInBuilds is removed or cannot be retrieved/found correctly, then 404 error will be raised.

Returns:

a list contains all the rtcclient.models.IncludedInBuild objects

Return 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 explanations

Returns:

a rtcclient.workitem.Workitem object

Return type:

rtcclient.workitem.Workitem

getStates()[source]

Get all rtcclient.models.State objects of this workitem

Returns:

a list contains all the rtcclient.models.State objects

Return type:

list

getSubscribers()[source]

Get subscribers of this workitem

Returns:

a list contains all the rtcclient.models.Member objects

Return 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

removeSubscriber(email)[source]

Remove a subscriber from this workitem

If the subscriber has not been added, no more actions will be performed.

Parameters:

email – the subscriber’s email

removeSubscribers(emails_list)[source]

Remove subscribers from this workitem

If the subscribers have not been added, no more actions will be performed.

Parameters:

emails_list – a list/tuple/set contains the the subscribers’ emails