Can't delete spurious "Affects" lines (bugtasks) from bug reports

Bug #1342 reported by Matthew Paul Thomas
92
This bug affects 8 people
Affects Status Importance Assigned to Milestone
Launchpad itself
Fix Released
Low
Ian Booth

Bug Description

If you accidentally recorded a bug as occurring in a particular project/package, and nobody else has changed its data (status/importance/assignee/milestone) for that project/package, you should have permission to delete that line from the bug report. And if you are the maintainer of a project, you should be able to delete the line regardless.

This is the task-specific counterpart to bug 1156. When this (and possibly bug 1156 too) is fixed, all bugtasks filed under the NULL project <https://launchpad.net/null> should be deleted, and so should the project itself.

Related branches

Brad Bollenbach (bradb)
Changed in malone:
assignee: nobody → bradb
status: New → Accepted
description: updated
Brad Bollenbach (bradb)
Changed in malone:
assignee: bradb → nobody
description: updated
description: updated
Tom Haddon (mthaddon)
tags: added: canonical-losa-lp
Ian Booth (wallyworld)
Changed in launchpad:
assignee: nobody → Ian Booth (wallyworld)
status: Triaged → In Progress
Revision history for this message
Launchpad QA Bot (lpqabot) wrote :
tags: added: qa-needstesting
Changed in launchpad:
status: In Progress → Fix Committed
Ian Booth (wallyworld)
tags: added: qa-ok
removed: qa-needstesting
William Grant (wgrant)
Changed in launchpad:
status: Fix Committed → In Progress
Revision history for this message
Ian Booth (wallyworld) wrote :

The API change is now live and here's an example script to use it:

from launchpadlib.launchpad import Launchpad

def test_delete_bugtask(bug_num, pillar_name):
    lp = Launchpad.login_with(
        'testing', service_root=uris.LPNET_SERVICE_ROOT, version='devel')
    bug = lp.bugs[bug_num]
    bugtasks = bug.bug_tasks
    if len(bugtasks) == 1:
        print "This bug has no extra bugtasks to be deleted."
    else:
        for bugtask in bugtasks:
            if bugtask.target.name == pillar_name:
                bugtask.lp_delete()
                print "deleted task for %s on bug %d." % (pillar_name, bug_num)

Changed in launchpad:
status: In Progress → Fix Released
Revision history for this message
Ian Booth (wallyworld) wrote :

Bug 878909 has been created for the work to expose this capability via the UI.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.