l.b.i.b.IBugAppend(Interface) : interface documentation

Part of lp.bugs.interfaces.bug View In Hierarchy

Known subclasses: lp.bugs.interfaces.webservice.IBug

IBug attributes that require launchpad.Append permission.
Method addAttachment Attach a file to this bug.
Method addCommentNotification Add a bug comment notification.
Method addChange Record a change to the bug.
Method addNomination Nominate a bug for an IDistroSeries or IProductSeries.
Method addWatch Create a new watch for this bug on the given remote bug and bug
Method removeWatch Remove a bug watch from the bug.
Method addTask Create a new bug task on this bug.
Method convertToQuestion Create and return a Question from this Bug.
Method expireNotifications Expire any pending notifications that have not been emailed.
Method findCvesInText Find any CVE references in the given text, make sure they exist
Method linkAttachment Link an ILibraryFileAlias to this bug.
Method linkMergeProposal Ensure that this MP is linked to this bug.
Method unlinkMergeProposal Ensure that any links between this bug and the given MP are removed.
Method linkCVE Ensure that this CVE is linked to this bug.
Method unlinkCVE Ensure that any links between this bug and the given CVE are
Method setPrivate Set bug privacy.
Method setSecurityRelated Set bug security.
Method transitionToInformationType Set the information type for this bug.
Method linkHWSubmission Link a HWSubmission to this bug.
Method unlinkHWSubmission Remove a link to a HWSubmission.
Method linkMessage Add a comment to this bug.
Method markUserAffected Mark :user: as affected by this bug.
Method markAsDuplicate Mark this bug as a duplicate of another.
Method setCommentVisibility Set the visible attribute on a bug comment. This is restricted
Method mute Add a muted subscription for person.
Method unmute Remove a muted subscription for person.
Method newMessage Create a new message, and link it to this object.
Method subscribe Subscribe person to the bug.
Method unsubscribe Remove this person's subscription to this bug.
Method unsubscribeFromDupes Remove this person's subscription from all dupes of this bug.
Method setStatus Set the status of the bugtask related to the specified target.
@call_with(REQUEST_USER, True)
@operation_parameters(Bytes(attachment_size_constraint), Text(), TextLine(), Bool(), TextLine(), Text())
@export_factory_operation(IBugAttachment, )
def addAttachment(owner, data, comment, filename, is_patch=False, content_type=None, description=None, from_api=False):
Attach a file to this bug.
Unknown Field: ownerAn IPerson.
Unknown Field: dataA file-like object, or a str.
Unknown Field: descriptionA brief description of the attachment.
Unknown Field: commentAn IMessage or string.
Unknown Field: filenameA string.
Unknown Field: is_patchA boolean.
def addCommentNotification(message, recipients=None, activity=None, level=BugNotificationLevel.COMMENTS):
Add a bug comment notification.

If a BugActivity instance is provided as an activity, it is linked to the notification.

def addChange(change, recipients=None, update_heat=True):
Record a change to the bug.

:param change: An `IBugChange` instance from which to take the
    change data.
:param recipients: A set of `IBugNotificationRecipient`s to whom
    to send notifications about this change. If None is passed
    the default list of recipients for the bug will be used.
:param update_heat: Whether to update the bug heat.
@operation_parameters(Reference(Interface, _('Target')))
@call_with(REQUEST_USER)
@export_factory_operation(Interface, )
def addNomination(owner, target):
Nominate a bug for an IDistroSeries or IProductSeries.

This method creates and returns a BugNomination. (See lp.bugs.model.bugnomination.BugNomination.)

Unknown Field: ownerAn IPerson.
Unknown Field: targetAn IDistroSeries or IProductSeries.
@call_with(REQUEST_USER)
@rename_parameters_as('bug_tracker', 'remote_bug')
@export_factory_operation(IBugWatch, 'bugtracker''remotebug')
def addWatch(bugtracker, remotebug, owner):
Create a new watch for this bug on the given remote bug and bug tracker, owned by the person given as the owner.
def removeWatch(bug_watch, owner):
Remove a bug watch from the bug.
@call_with(REQUEST_USER)
@operation_parameters(copy_field(IBugTask['target']))
@export_factory_operation(IBugTask, )
def addTask(owner, target):
Create a new bug task on this bug.
RaisesIllegalTargetif the bug task cannot be added to the bug.
def convertToQuestion(person, comment=None):
Create and return a Question from this Bug.

Bugs that are also in external bug trackers cannot be converted to questions. This is also true for bugs that are being developed.

The IQuestionTarget is provided by the IBugTask that is not Invalid and is not a conjoined slave. Only one question can be made from a bug.

An AssertionError is raised if the bug has zero or many BugTasks that can provide a QuestionTarget. It will also be raised if a question was previously created from the bug.

Unknown Field: personThe IPerson creating a question from this bug
Unknown Field: commentA string. An explanation of why the bug is a question.
def expireNotifications():
Expire any pending notifications that have not been emailed.

This will mark any notifications related to this bug as having been emailed. The intent is to prevent large quantities of bug mail being generated during bulk imports or changes.

def findCvesInText(text, user):
Find any CVE references in the given text, make sure they exist in the database, and are linked to this bug.

The user is the one linking to the CVE.

def linkAttachment(owner, file_alias, comment, is_patch=False, description=None):
Link an ILibraryFileAlias to this bug.

This method should only be called by addAttachment() and FileBugViewBase.submit_bug_action, otherwise we may get inconsistent settings of bug.private and file_alias.restricted.

Unknown Field: ownerAn IPerson.
Unknown Field: file_aliasThe ILibraryFileAlias to link to this bug.
Unknown Field: descriptionA brief description of the attachment.
Unknown Field: commentAn IMessage or string.
Unknown Field: is_patchA boolean.
@call_with(REQUEST_USER)
@operation_parameters(Reference(Interface, _('Merge proposal'), True))
@export_write_operation()
@operation_for_version('devel')
def linkMergeProposal(merge_proposal, user, check_permissions=True):
Ensure that this MP is linked to this bug.
@call_with(REQUEST_USER)
@operation_parameters(Reference(Interface, _('Merge proposal'), True))
@export_write_operation()
@operation_for_version('devel')
def unlinkMergeProposal(merge_proposal, user, check_permissions=True):
Ensure that any links between this bug and the given MP are removed.
@call_with(REQUEST_USER)
@operation_parameters(Reference(ICve, _('CVE'), True))
@export_write_operation()
def linkCVE(cve, user, check_permissions=True):
Ensure that this CVE is linked to this bug.
@call_with(REQUEST_USER)
@operation_parameters(Reference(ICve, _('CVE'), True))
@export_write_operation()
def unlinkCVE(cve, user, check_permissions=True):
Ensure that any links between this bug and the given CVE are removed.
@mutator_for(IBugPublic['private'])
@operation_parameters(copy_field(IBugPublic['private']))
@call_with(REQUEST_USER)
@export_write_operation()
def setPrivate(private, who):
Set bug privacy.

Return True if a change is made, False otherwise.

Unknown Field: privateTrue/False.
Unknown Field: whoThe IPerson who is making the change.
@mutator_for(IBugView['security_related'])
@operation_parameters(copy_field(IBugView['security_related']))
@call_with(REQUEST_USER)
@export_write_operation()
def setSecurityRelated(security_related, who):
Set bug security.

Return True if a change is made, False otherwise.

Unknown Field: security_relatedTrue/False.
Unknown Field: whoThe IPerson who is making the change.
@operation_parameters(copy_field(IBugPublic['information_type']))
@call_with(REQUEST_USER)
@export_write_operation()
@operation_for_version('devel')
def transitionToInformationType(information_type, who):
Set the information type for this bug.
Unknown Field: information_typeThe InformationType to transition to.
Unknown Field: whoThe IPerson who is making the change.
@operation_parameters(Reference(Interface, _('A HWDB submission'), True))
@export_write_operation()
def linkHWSubmission(submission):
Link a HWSubmission to this bug.
@operation_parameters(Reference(Interface, _('A HWDB submission'), True))
@export_write_operation()
def unlinkHWSubmission(submission):
Remove a link to a HWSubmission.
def linkMessage(message, bugwatch=None, user=None, remote_comment_id=None):
Add a comment to this bug.
ParametersmessageThe IMessage to be used as a comment.
bugwatchThe IBugWatch of the bug this comment was imported from, if it's an imported comment.
userThe IPerson adding the comment.
remote_comment_idThe id this comment has in the remote bug tracker, if it's an imported comment.
@operation_parameters(Bool(_('Does this bug affect you?'), False, True))
@call_with(REQUEST_USER)
@export_write_operation()
def markUserAffected(user, affected=True):
Mark :user: as affected by this bug.
@mutator_for(IBugView['duplicateof'])
@operation_parameters(copy_field(IBugView['duplicateof']))
@export_write_operation()
def markAsDuplicate(duplicate_of):
Mark this bug as a duplicate of another.
@operation_parameters(Int(_('The number of the comment in the list of messages.'), True), Bool(_('Show this comment?'), True))
@call_with(REQUEST_USER)
@export_write_operation()
def setCommentVisibility(user, comment_number, visible):
Set the visible attribute on a bug comment. This is restricted to Launchpad admins, and will return a HTTP Error 401: Unauthorized error for non-admin callers.
@operation_parameters(Reference(IPerson, _('Person'), False))
@call_with(REQUEST_USER)
@export_write_operation()
@operation_for_version('devel')
def mute(person, muted_by):
Add a muted subscription for person.
@operation_parameters(Reference(IPerson, _('Person'), False))
@call_with(REQUEST_USER)
@export_write_operation()
@operation_for_version('devel')
def unmute(person, unmuted_by):
Remove a muted subscription for person.

Returns previously muted direct subscription, if any.

@operation_parameters(optional_message_subject_field(), copy_field(IMessage['content']))
@call_with(REQUEST_USER)
@export_factory_operation(IMessage, )
def newMessage(owner, subject, content):
Create a new message, and link it to this object.
@operation_parameters(Reference(IPerson, _('Person'), True), Choice(BugNotificationLevel, False, _('Level')))
@call_with(REQUEST_USER, False)
@export_write_operation()
def subscribe(person, subscribed_by, suppress_notify=True, level=None):
Subscribe person to the bug.
Parameterspersonthe subscriber.
subscribed_bythe person who created the subscription.
suppress_notifya flag to suppress notify call.
levelThe BugNotificationLevel for the new subscription.
Returnsan IBugSubscription.
@operation_parameters(Reference(IPerson, _('Person'), False))
@call_with(REQUEST_USER)
@export_write_operation()
def unsubscribe(person, unsubscribed_by):
Remove this person's subscription to this bug.
@operation_parameters(Reference(IPerson, _('Person'), False))
@call_with(REQUEST_USER)
@export_write_operation()
def unsubscribeFromDupes(person, unsubscribed_by):
Remove this person's subscription from all dupes of this bug.
def setStatus(target, status, user):
Set the status of the bugtask related to the specified target.

If a bug task was edited, emit a lazr.lifecycle.interfaces.IObjectModifiedEvent and return the edited bugtask.

Return None if no bugtask was edited.

Unknown Field: targetThe target of the bugtask that should be modified.
Unknown Field: statusThe status the bugtask should be set to.
Unknown Field: userThe IPerson doing the change.
API Documentation for Launchpad, generated by pydoctor at 2022-06-16 00:00:12.