l.b.i.w.IBugTask(IHasBug, IBugTaskDelete) : interface documentation

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

Known subclasses: lp.bugs.browser.bugtask.IBugTaskEditForm

A bug needing fixing in a particular product or package.
Int id Undocumented
Choice product Undocumented
Attribute productID The product ID
Choice productseries Undocumented
Attribute productseriesID The product series ID
Choice sourcepackagename Undocumented
Attribute sourcepackagenameID The sourcepackagename ID
Choice distribution Undocumented
Attribute distributionID The distribution ID
Choice distroseries Undocumented
Attribute distroseriesID The distroseries ID
Attribute milestoneID The id of the milestone.
Int assigneeID Undocumented
Datetime age The age of this task, expressed as the length of time between the creation date and now.
Int task_age The age of this task in seconds, a delta between now and the date the bug task was created.
Choice pillar The LP pillar (product or distribution) associated with this task.
Attribute other_affected_pillars The other pillars (products or distributions) affected by this bug. This returns a list of pillars OTHER THAN the pillar associated with this particular bug.
Field bug_subscribers Undocumented
Attribute conjoined_master The series-specific bugtask in a conjoined relationship
Attribute conjoined_slave The generic bugtask in a conjoined relationship
Method findSimilarBugs Return the list of possible duplicates for this BugTask.
Method getContributorInfo Is the person a contributor to bugs in this task's pillar?
Method getConjoinedMaster Return the conjoined master in the given bugtasks, if any.
Method subscribe Subscribe this person to the underlying bug.
Method isSubscribed Return True if the person is an explicit subscriber to the
Method transitionToMilestone Set the BugTask milestone.
Method transitionToImportance Set the BugTask importance.
Method canTransitionToStatus Return True if the user is allowed to change the status to
Method transitionToStatus Perform a workflow transition to the new_status.
Method userCanSetAnyAssignee Check if the current user can set anybody sa a bugtask assignee.
Method userCanUnassign Check if the current user can set assignee to None.
Method transitionToAssignee Perform a workflow transition to the given assignee.
Method validateTransitionToTarget Check whether a transition to this target is legal.
Method transitionToTarget Convert the bug task to a different bug target.
Method updateTargetNameCache Update the targetnamecache field in the database.
Method asEmailHeaderValue Return a value suitable for an email header value for this bugtask.
Method getDelta Compute the delta from old_task to this task.
Method getPackageComponent Return the task's package's component or None.
Method userHasDriverPrivileges Does the user have driver privileges on the current bugtask?
Method userHasBugSupervisorPrivileges Is the user privileged and allowed to change details on a bug?
Attribute _status The actual status DB column used in queries.

Inherited from IHasBug:

Int bug Undocumented

Inherited from IBugTaskDelete:

Method delete Delete this bugtask.
id =
Undocumented
product =
Undocumented
productID =
The product ID
productseries =
Undocumented
productseriesID =
The product series ID
sourcepackagename =
Undocumented
sourcepackagenameID =
The sourcepackagename ID
distribution =
Undocumented
distributionID =
The distribution ID
distroseries =
Undocumented
distroseriesID =
The distroseries ID
milestoneID =
The id of the milestone.
_status =
The actual status DB column used in queries.
assigneeID =
Undocumented
age =
The age of this task, expressed as the length of time between the creation date and now.
task_age =
The age of this task in seconds, a delta between now and the date the bug task was created.
pillar =
The LP pillar (product or distribution) associated with this task.
other_affected_pillars =
The other pillars (products or distributions) affected by this bug. This returns a list of pillars OTHER THAN the pillar associated with this particular bug.
bug_subscribers =
Undocumented
conjoined_master =
The series-specific bugtask in a conjoined relationship
conjoined_slave =
The generic bugtask in a conjoined relationship
@operation_returns_collection_of(Interface)
@call_with(REQUEST_USER, 10)
@export_read_operation()
def findSimilarBugs(user, limit=10):
Return the list of possible duplicates for this BugTask.
@call_with(REQUEST_USER)
@operation_parameters(copy_field(assignee))
@export_read_operation()
@operation_for_version('devel')
def getContributorInfo(user, person):
Is the person a contributor to bugs in this task's pillar?

Return a dict with the following values: is_contributor: True if the user has any bugs assigned to them in the context of this bug task's pillar, either directly or by team participation. person_name: the displayname of the person pillar_name: the displayname of the bug task's pillar

This API call is provided for use by the client Javascript where the calling context does not have access to the person or pillar names.

ParametersuserThe user doing the search. Private bugs that this user doesn't have access to won't be included in the search.
personThe person to check to see if they are a contributor.
def getConjoinedMaster(bugtasks, bugtasks_by_package=None):
Return the conjoined master in the given bugtasks, if any.

This method exists mainly to allow calculating the conjoined master from a cached list of bug tasks, reducing the number of db queries needed.

ParametersbugtasksThe bugtasks to be considered when looking for the conjoined master.
bugtasks_by_packageA cache, mapping a ISourcePackageName to a list of bug tasks targeted to such a package name. Both distribution and distro series tasks should be included in this list.
def subscribe(person, subscribed_by):
Subscribe this person to the underlying bug.

This method was documented as being required here so that MentorshipOffers could happen on IBugTask. If that was the sole reason this method should be deletable. When we move to context-less bug presentation (where the bug is at /bugs/n?task=ubuntu) then we can eliminate this if it is no longer useful.

def isSubscribed(person):
Return True if the person is an explicit subscriber to the underlying bug for this bugtask.

This method was documented as being required here so that MentorshipOffers could happen on IBugTask. If that was the sole reason then this method should be deletable. When we move to context-less bug presentation (where the bug is at /bugs/n?task=ubuntu) then we can eliminate this if it is no longer useful.

@mutator_for(milestone)
@rename_parameters_as('milestone')
@operation_parameters(copy_field(milestone))
@call_with(REQUEST_USER)
@export_write_operation()
def transitionToMilestone(new_milestone, user):
Set the BugTask milestone.

Set the bugtask milestone, making sure that the user is authorised to do so.

@mutator_for(importance)
@rename_parameters_as('importance')
@operation_parameters(copy_field(importance))
@call_with(REQUEST_USER)
@export_write_operation()
def transitionToImportance(new_importance, user):
Set the BugTask importance.

Set the bugtask importance, making sure that the user is authorised to do so.

def canTransitionToStatus(new_status, user):
Return True if the user is allowed to change the status to new_status.

Some status transitions, e.g. Triaged, require that the user be a bug supervisor or the owner of the project.

Unknown Field: new_statusnew status from BugTaskStatus
Unknown Field: userthe user requesting the change
@mutator_for(status)
@rename_parameters_as('status')
@operation_parameters(copy_field(status))
@call_with(REQUEST_USER)
@export_write_operation()
def transitionToStatus(new_status, user):
Perform a workflow transition to the new_status.

For certain statuses, e.g. Confirmed, other actions will happen, like recording the date when the task enters this status.

Some status transitions require extra conditions to be met. See canTransitionToStatus for more details.

Unknown Field: new_statusnew status from BugTaskStatus
Unknown Field: userthe user requesting the change
def userCanSetAnyAssignee(user):
Check if the current user can set anybody sa a bugtask assignee.

Owners, drivers, bug supervisors and Launchpad admins can always assign to someone else. Other users can assign to someone else if a bug supervisor is not defined.

def userCanUnassign(user):
Check if the current user can set assignee to None.
@mutator_for(assignee)
@operation_parameters(copy_field(assignee))
@export_write_operation()
def transitionToAssignee(assignee, validate=True):
Perform a workflow transition to the given assignee.

When the bugtask assignee is changed from None to an IPerson object, the date_assigned is set on the task. If the assignee value is set to None, date_assigned is also set to None.

def validateTransitionToTarget(target):
Check whether a transition to this target is legal.
RaisesIllegalTargetif the new target is not allowed.
@mutator_for(target)
@call_with(REQUEST_USER)
@operation_parameters(copy_field(target))
@export_write_operation()
def transitionToTarget(target, user):
Convert the bug task to a different bug target.
def updateTargetNameCache():
Update the targetnamecache field in the database.

This method is meant to be called when an IBugTask is created or modified and will also be called from the update_stats.py cron script to ensure that the targetnamecache is properly updated when, for example, an IDistribution is renamed.

def asEmailHeaderValue():
Return a value suitable for an email header value for this bugtask.

The return value is a single line of arbitrary length, so header folding should be done by the callsite, as needed.

For an upstream task, this value might look like:

product=firefox; status=New; importance=Critical; assignee=None;

See doc/bugmail-headers.txt for a complete explanation and more examples.

def getDelta(old_task):
Compute the delta from old_task to this task.

Returns an IBugTaskDelta or None if there were no changes between old_task and this task.

def getPackageComponent():
Return the task's package's component or None.

Returns the component associated to the current published package in that distribution's current series. If the task is not a package task, returns None.

def userHasDriverPrivileges(user):
Does the user have driver privileges on the current bugtask?
ReturnsA boolean.
def userHasBugSupervisorPrivileges(user):
Is the user privileged and allowed to change details on a bug?
ReturnsA boolean.
API Documentation for Launchpad, generated by pydoctor at 2022-06-16 00:00:12.