milestone bugs

Asked by Parul Kamra

Hi,

How can I get all bugs of particular milestone using url (https://api.staging.launchpad.net/1.0/ )?
Which parameters I have to pass in url to get bugs of particular milestone.
I am not using Python.
I just to fetch entries in another language using this above url.
Please help me out

Thanks

Question information

Language:
English Edit question
Status:
Expired
For:
Launchpad itself Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Colin Watson (cjwatson) said :
#1

The API method you're looking for is this one:

  https://launchpad.net/+apidoc/devel.html#milestone-searchTasks

So you first need to get the URL for the milestone in question. Then this is a read operation (https://help.launchpad.net/API/Hacking#Read_operations_.28GET.29), so append "&ws.op=searchTasks", plus any additional parameters you need. This will give you the first batch in the collection, and then you can see https://help.launchpad.net/API/Hacking#A_collection:_the_list_of_bugs for how to fetch further batches.

A useful way to work out what you need to do is to play around in Python with launchpadlib with httplib2.debuglevel set to 1 (see https://help.launchpad.net/API/launchpadlib#Three_things_to_make_your_client_faster), which will make it print out the URLs it's using along the way. You can then translate that to whatever language you need to use instead.

Revision history for this message
Parul Kamra (itz-me-parul) said :
#2

Hi Colin,

Thanks for your quick reply.

But my problem didn't solve.

Suppose, my project name is abc & I want to fetch bugs of this project but for a particular milestone so what will be the url?
As of now I am trying below url to get the result but it's not fetching bugs for that project's milestone.

https://api.launchpad.net/1.0/abc/?ws.op=searchTasks&milestone=r3.0

but this says, milestone is not a valid url.

Can you explain me how to pass parameters in above url to get bugs for a particular milestone in a project?

Regards,
Parul

Revision history for this message
Colin Watson (cjwatson) said :
#3

The first step in my answer was "you first need to get the URL for the milestone in question". So, you first need to request https://api.launchpad.net/1.0/abc?ws.op=getMilestone&name=r3.0, which will give you a JSON object describing the milestone. The "self_link" element of that object is the milestone URL. You can then append ?ws.op=searchTasks to that (without the &milestone= bit).

Revision history for this message
Parul Kamra (itz-me-parul) said :
#4

Hi Colin,

Thanks a ton for your support.

90% of my problem has been solved.
But There are 2 questions still left which I want to ask.

Ques 1 -
As per your last response, below url fetches milestone(r3.0) bugs of project abc. This is exactly what I was looking for
The url - https://api.launchpad.net/1.0/abc?ws.op=getMilestone&name=r3.0,

But Suppose, I want to fetch those bugs which do not have milestones, then what should be the url in that case?

Ques 2 -
As of now, it seems that I can fetch 75 bugs at a time. In order to go to next 75 bugs, I need to use - "next_collection_link" index of an object. Is it possible that I can fetch all the bugs at a time without using "next_collection_link"?
I know I can use ws.size variable to increase the number of bugs but the problem is - I am not sure how many bugs could be there in a particular milestone.

Thanks once again for your help.

Regards,
Parul

Revision history for this message
Parul Kamra (itz-me-parul) said :
#5

Hi Colin,

Could you please help me out to resolve above issue that I asked from you ?

Thanks

Revision history for this message
Colin Watson (cjwatson) said :
#6

There's no single way to search specifically for bugs that have no milestones. You'll have to search for tasks in the whole project (https://api.launchpad.net/1.0/abc?ws.op=searchTasks) and filter out those with milestones manually.

Please follow my previous advice on using next_collection_link etc. rather than trying to increase the batch size; we have batching for a reason. Trying to increase the batch size will eventually just result in timeouts. Your code should follow next_collection_link until it runs out of batches. (Python programmers mostly don't have to worry about this, since launchpadlib deals with the mechanics of iterating over the collection.)

Revision history for this message
Parul Kamra (itz-me-parul) said :
#7

Hi Colin,

Thanks for your great support.
Now, the problem has been solved.
Thanks again.

Regards,
Parul
On Jun 15, 2016 3:13 PM, "Colin Watson" <
<email address hidden>> wrote:

> Your question #295101 on Launchpad itself changed:
> https://answers.launchpad.net/launchpad/+question/295101
>
> Status: Open => Answered
>
> Colin Watson proposed the following answer:
> There's no single way to search specifically for bugs that have no
> milestones. You'll have to search for tasks in the whole project
> (https://api.launchpad.net/1.0/abc?ws.op=searchTasks) and filter out
> those with milestones manually.
>
> Please follow my previous advice on using next_collection_link etc.
> rather than trying to increase the batch size; we have batching for a
> reason. Trying to increase the batch size will eventually just result
> in timeouts. Your code should follow next_collection_link until it runs
> out of batches. (Python programmers mostly don't have to worry about
> this, since launchpadlib deals with the mechanics of iterating over the
> collection.)
>
> --
> If this answers your question, please go to the following page to let us
> know that it is solved:
>
> https://answers.launchpad.net/launchpad/+question/295101/+confirm?answer_id=5
>
> If you still need help, you can reply to this email or go to the
> following page to enter your feedback:
> https://answers.launchpad.net/launchpad/+question/295101
>
> You received this question notification because you asked the question.
>

Revision history for this message
William Grant (wgrant) said :
#8

Solved.

Revision history for this message
Parul Kamra (itz-me-parul) said :
#9

Hi Colin,

There is a one question that I want to ask -

I am trying to fetch bugs which are modified ? -
if I fetch data since modified date.

Eg - https://api.launchpad.net/1.0/juniperopenstack/+milestone/r3.1.0.0-fcs?ws.op=searchTasks&modified_since=2016-06-08

According to concept - It will fetch all modified bugs till above date.

But if I fetch data at below date -

Eg - https://api.launchpad.net/1.0/juniperopenstack/+milestone/r3.1.0.0-fcs?ws.op=searchTasks&modified_since=2016-06-09

Then, why is it fetching data of first date(2016-06-08) even if it is not modified.

I want to fetch only modified data on daily basis.
So, What url I will use to get modified data everyday?

Thanks & Regards,

Parul

Revision history for this message
William Grant (wgrant) said :
#10

Do you have a specific example of a bug that appears that you think shouldn't be there?

Revision history for this message
Parul Kamra (itz-me-parul) said :
#11

Hi William,

I want to ask a question.

I want to get bugs of this milestone - r2.22.3
using same concept as i did for others.

https://api.launchpad.net/1.0/juniperopenstack/+milestone/r2.22.3?ws.op=searchTasks

But this url fetches 0 entry which is not possible because bugs are present in this milestone.

I think r2.22.3 is a milestone of r2.22.x series. So there may be different concept for fetching bugs of it.

The other thing that I noticed is that - all milestones like( r3.1.0.0-fcs , r2.21.2) belong to target name - juniperopenstack whereas r2.22.3 belong to target name - juniperopenstack r2.22.x

Please advice on it.

Thanks & Regards
Parul

Revision history for this message
William Grant (wgrant) said :
#12

searchTasks omits series tasks by default. Try passing in omit_targeted=false.

Revision history for this message
Parul Kamra (itz-me-parul) said :
#13

Hi William,

Thanks for your response.

Why are we using omit_targeted=false ?
How may I get to know that this milestone requires omit_targeted=false or not?

 If I use your concept to add omit_targeted=false for milestone r2.22.3, then it fetches actual count of bugs i.e. 21 as on launchpad.

eg- I used omit_targeted=false for milestone r3.1.0.0-fcs as
https://api.launchpad.net/1.0/juniperopenstack/+milestone/r3.1.0.0-fcs?ws.op=searchTasks&omit_targeted=false

But If I do not use omit_target=false, then it fetches actual count of bugs for this milestone as given on launchpad i.e. 765.
Then it increased bugs count i.e. 1502.

eg - same concept I used for r2.21.2, which is a milestone of r2.21.x, it fetches bugs without using omit_targeted=false but not actual count of bugs.

Please clear my doubts What is the use of omit_targeted=false

Regards,
Parul

Revision history for this message
Parul Kamra (itz-me-parul) said :
#14

Hi,

Could you please help me with the below two questions:

1) I was fetching bugs using url :- https://api.launchpad.net/1.0/juniperopenstack/+milestone/r3.1.0.0-fcs?ws.op=searchTasks&status=In Progress
It shows 64 bugs right now.

But when I checked in url - https://launchpad.net/juniperopenstack/+milestone/r3.1.0.0-fcs
Bugs count for status - in progress is - 65 bugs

Why there is difference in counts here? Similar is the case with Status Won't Fix. Count in Launchpad is 7 but I am getting only 3.

2) When we use url-
https://api.launchpad.net/1.0/juniperopenstack/+milestone/r3.1.0.0-fcs?ws.op=searchTasks ,
 I was expecting to get bugs from all status. But instead status like won't fix, fixed released, etc are not coming through.

Could you please guide me how to get all of them without specifically mentioning their status in the url?

Thanks in advance.

Regards,
Parul

Revision history for this message
Launchpad Janitor (janitor) said :
#15

This question was expired because it remained in the 'Open' state without activity for the last 15 days.