tcms.bugs.api module

tcms.bugs.api.add_attachment(bug_id, filename, b64content, **kwargs)[source]
RPC Bug.add_attachment(bug_id, filename, b64content)

Add attachment to the given Bug.

Parameters:
  • bug_id (int) – PK of Bug

  • filename (str) – File name of attachment, e.g. ‘logs.txt’

  • b64content (str) – Base64 encoded content

  • **kwargs – Dict providing access to the current request, protocol, entry point name and handler instance from the rpc method

tcms.bugs.api.add_comment(bug_id, comment, user_id=None, submit_date=None, **kwargs)[source]
RPC Bug.add_comment(bug_id, comment)

Add comment to selected Bug.

Parameters:
  • bug_id (int) – PK of a Bug object

  • comment (str) – The text to add as a comment

  • user_id (int) – Override comment user field. Only super-user can use this!

  • submit_date (datetime.datetime) – Override comment submit_date field. Only super-user can use this!

  • **kwargs – Dict providing access to the current request, protocol, entry point name and handler instance from the rpc method

Returns:

Serialized django_comments.models.Comment object

Return type:

dict

Raises:

PermissionDenied – if missing django_comments.add_comment permission

Added in version 15.3.

tcms.bugs.api.add_execution(bug_id, execution_id)[source]
RPC Bug.add_execution(bug_id, execution_id)

Add TestExecution to the specified Bug.

Parameters:
  • bug_id (int) – PK of Bug to modify

  • execution_id (int) – PK of TestExecution to be added

Raises:

Added in version 15.3.

tcms.bugs.api.add_tag(bug_id, tag, **kwargs)[source]
RPC Bug.add_tag(bug_id, tag)

Add one tag to the specified Bug.

Parameters:
  • bug_id (int) – PK of Bug to modify

  • tag (str) – Tag name to add

  • **kwargs – Dict providing access to the current request, protocol, entry point name and handler instance from the rpc method

Raises:
  • PermissionDenied – if missing bugs.add_bug_tags permission

  • Bug.DoesNotExist – if object specified by PK doesn’t exist

  • Tag.DoesNotExist – if missing management.add_tag permission and tag doesn’t exist in the database!

tcms.bugs.api.create(values, **kwargs)[source]
RPC Bug.create(values)

Create a new Bug object and store it in the database.

Parameters:
  • values (dict) – Field values for tcms.bugs.models.Bug

  • **kwargs – Dict providing access to the current request, protocol, entry point name and handler instance from the rpc method

Returns:

Serialized tcms.bugs.models.Bug object

Return type:

dict

Raises:
  • ValueError – if input values don’t validate

  • PermissionDenied – if missing bugs.add_bug permission

Added in version 15.3.

tcms.bugs.api.filter(query)[source]
RPC Bug.filter(query)

Get list of bugs.

Parameters:

query (dict) – Field lookups for tcms.bugs.models.Bug

Returns:

List of serialized tcms.bugs.models.Bug objects.

Return type:

list

tcms.bugs.api.filter_canonical(query)[source]
RPC Bug.filter_canonical(query)

Get a list of bugs where FKs are reported as IDs.

Parameters:

query (dict) – Field lookups for tcms.bugs.models.Bug

Returns:

List of serialized tcms.bugs.models.Bug objects.

Return type:

list

Added in version 15.3.

tcms.bugs.api.get_comments(bug_id)[source]
RPC Bug.get_comments(bug_id)

Get all comments for selected Bug.

Parameters:

bug_id (int) – PK of a Bug object

Returns:

Serialized django_comments.models.Comment object

Return type:

list(dict)

Raises:

PermissionDenied – if missing django_comments.view_comment permission

Added in version 15.3.

tcms.bugs.api.list_attachments(bug_id, **kwargs)[source]
RPC Bug.list_attachments(bug_id)

List attachments for the given Bug.

Parameters:
  • bug_id (int) – PK of Bug to inspect

  • **kwargs – Dict providing access to the current request, protocol, entry point name and handler instance from the rpc method

Returns:

A list containing information and download URLs for attachements

Return type:

list

Raises:

Bug.DoesNotExist – if object specified by PK is missing

Added in version 15.3.

tcms.bugs.api.remove(query)[source]
RPC Bug.remove(bug_id)

Remove Bug object(s).

Parameters:

query (dict) – Field lookups for tcms.bugs.models.Bug

Raises:

PermissionDenied – if missing bugs.delete_bugtag permission

tcms.bugs.api.remove_tag(bug_id, tag)[source]
RPC Bug.remove_tag(bug_id, tag)

Remove tag from a Bug.

Parameters:
  • bug_id (int) – PK of Bug to modify

  • tag (str) – Tag name to remove

Raises:
  • PermissionDenied – if missing bugs.delete_bug_tags permission

  • DoesNotExist – if objects specified don’t exist

tcms.bugs.api.severity_create(values)[source]
RPC Severity.create(values)

Create a new Severity object and store it in the database.

Parameters:

values (dict) – Field values for tcms.bugs.models.Severity

Returns:

Serialized tcms.bugs.models.Severity object

Return type:

dict

Raises:
  • ValueError – if input values don’t validate

  • PermissionDenied – if missing bugs.add_severity permission

Added in version 15.2.

tcms.bugs.api.severity_filter(query)[source]
RPC Severity.filter(query)

Get list of bug severities.

Parameters:

query (dict) – Field lookups for tcms.bugs.models.Severity

Returns:

List of serialized tcms.bugs.models.Severity objects.

Return type:

list

Added in version 15.2.