l.b.i.b.IBugTask(IHasDateCreated, IHasBug, ICanBeMentored) : interface documentation

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

Known subclasses: lp.bugs.interfaces.bugtask.IDistroBugTask, lp.bugs.interfaces.bugtask.IDistroSeriesBugTask, lp.bugs.interfaces.bugtask.INullBugTask, lp.bugs.interfaces.bugtask.IProductSeriesBugTask, lp.bugs.interfaces.bugtask.IUpstreamBugTask

Known implementations: lp.bugs.model.bugtask.BugTask

A bug needing fixing in a particular product or package.
Int id Undocumented
Choice product Undocumented
Choice productseries Undocumented
Attribute productseriesID The product series ID
Choice sourcepackagename Undocumented
Choice distribution Undocumented
Choice distroseries Undocumented
Text statusexplanation 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.
Bool target_uses_malone Undocumented
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 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 setImportanceFromDebbugs Set the Launchpad BugTask importance on the basis of a debbugs
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 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 userCanEditMilestone Can the user edit the Milestone field?
Method userCanEditImportance Can the user edit the Importance field?

Inherited from IHasDateCreated:

Attribute datecreated The date on which I was created.

Inherited from IHasBug:

Int bug Undocumented

Inherited from ICanBeMentored:

Method canMentor True if this user could now offer mentoring on this piece of
Method isMentor True if the user is offering mentoring for this piece of work.
Method offerMentoring Record that the user is willing to mentor anyone who is trying to
Method retractMentoring Remove the offer of mentoring for this work by this user.

Inherited from IHasMentoringOffers (via ICanBeMentored):

Attribute mentoring_offers The list of mentoring offers related to this object.
id =
Undocumented
product =
Undocumented
productseries =
Undocumented
productseriesID =
The product series ID
sourcepackagename =
Undocumented
distribution =
Undocumented
distroseries =
Undocumented
statusexplanation =
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.
target_uses_malone =
Undocumented
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.
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 is required here so that MentorshipOffers can happen on IBugTask. 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 is required here so that MentorshipOffers can happen on IBugTask. 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 setImportanceFromDebbugs(severity):
Set the Launchpad BugTask importance on the basis of a debbugs severity. This maps from the debbugs severity values ('normal', 'important', 'critical', 'serious', 'minor', 'wishlist', 'grave') to the Launchpad importance values, and returns the relevant Launchpad importance.
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.

Project owner, project drivers, series drivers, bug supervisors and Launchpad admins can do this always; other users can do this only if they or their reams are the assignee.

@mutator_for(assignee)
@operation_parameters(copy_field(assignee))
@export_write_operation()
def transitionToAssignee(assignee):
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.

@mutator_for(target)
@operation_parameters(copy_field(target))
@export_write_operation()
def transitionToTarget(target):
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.

old_task and this task are either both IDistroBugTask's or both IUpstreamBugTask's, otherwise a TypeError is raised.

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 userCanEditMilestone(user):
Can the user edit the Milestone field?
def userCanEditImportance(user):
Can the user edit the Importance field?
API Documentation for Launchpad, generated by pydoctor at 2010-09-27 00:00:11.