Launchpadlib how to get bug id from bug_link

I'm not sure if this is a python question or a launchpad question since I am new to both. I am getting a collection of bugs in a bug_task collection. I am running searchTasks. The API reference documentation says bug_link is a link to a bug object. The bug object has the id. I was hoping to be able to print out the bug id by just getting the attribute, but that is not working.

Here is the relevant snippet of code:

bug_tasks = series.searchTasks(status=['New'],importance=['Critical'])
for bug in bug_tasks: print(bug) bug_link=bug.bug_link bug_id=bug_link.id print(bug_id)

When I run the script, I get the error

Traceback (most recent call last): File "./get_ubuntu_bug_list.py", line 39, in <module> bug_id=bug_link.id
AttributeError: 'unicode' object has no attribute 'id'

I've also tried

bug_id=bug_link.get(id)
bug_id=get(bug_link.id)
bug_id=get(bug_link).id

None of those worked.

Any help on how to get the bug id from bug_link would be appreciated.

Thank you

2 Reset to default

Know someone who can answer? Share a link to this question via email, Twitter, or Facebook.

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like