Closed Bug 660180 Opened 13 years ago Closed 13 years ago

bug/123 and bug?id=123 gives inconsistent results

Categories

(Webtools Graveyard :: BzAPI, defect)

defect
Not set
major

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: jon.skarpeteig, Assigned: gerv)

References

()

Details

User-Agent:       Mozilla/5.0 (Windows NT 6.1; WOW64; rv:2.0.1) Gecko/20100101 Firefox/4.0.1
Build Identifier: bzapi 0.9

Some information appears to be missing, when using the search shortcut to look up multiple ids. For example, the dupe_of field is not present:

https://api-dev.bugzilla.mozilla.org/test/0.9/bug/2079

dupe_of showing

https://api-dev.bugzilla.mozilla.org/test/0.9/bug?id=2079

dupe_of missing

Reproducible: Always



Expected Results:  
My assumption was that the methods should return an equal resultset of the same bug as defined in https://wiki.mozilla.org/Bugzilla:REST_API:Objects#Bug
Sorry - this changed a year ago but the documentation has not been updated. I've now done that.

The way to get all the data is now to specify "include_fields=_all" on your search. If that gives you too much (and it will give you more than an ordinary /bug/<id> call), see the docs for including and excluding fields. Note that requesting history requires an extra call to Bugzilla so, if you don't need that, excluding it will improve performance.

Gerv
Status: UNCONFIRMED → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Specifying fields _default,dupe_of,update_token solves my issue, thanks. I think the documentation is a bit unclear still on the fact that it's not the same object that is returned for /bug/123 and /bug?id=123 (as the _default fields doesn't match)
Status: RESOLVED → UNCONFIRMED
Resolution: FIXED → ---
I've added another explanatory sentence; if that still doesn't work for you, please propose additional text :-)

Gerv
Status: UNCONFIRMED → RESOLVED
Closed: 13 years ago13 years ago
Resolution: --- → FIXED
I love the quick and accurate responses here. :-D Thumbs up!

Documentation of Retrieve bug (/bug/<id> GET):

"If you want to retrieve multiple Bugs at once, use the Search interface and specify only Bug IDs as your search criteria. You will be returned full Bug objects instead of the reduced number of fields normally presented on a Search. This is a shortcut to avoid people having to make 20 calls to get 20 full bug objects."

This particular line was confusing to me, when the 'dupe_of' field was missing as I assumed the "full bug object" would contain (at least) the same fields as "reduced number of fields".

E.G the example from documentation: https://api-dev.bugzilla.mozilla.org/latest/bug/350001?include_fields=_default,comments,history,attachments.data

compared to:

https://api-dev.bugzilla.mozilla.org/latest/bug?id=350001&include_fields=_default,comments,history,attachments.data

Does not retrieve the same bug object resultset. (whereas the _default fields are different in between the two)

From my initial example:
https://api-dev.bugzilla.mozilla.org/latest/bug/2079?include_fields=_default
https://api-dev.bugzilla.mozilla.org/latest/bug?id=2079&include_fields=_default

The latter does NOT include dupe_of, while the first do.
Status: RESOLVED → UNCONFIRMED
Resolution: FIXED → ---
Jon: when making suggestions for improvement, are you reviewing the most recent documentation?

https://wiki.mozilla.org/Bugzilla:REST_API:Methods#Retrieve_bug_.28.2Fbug.2F.3Cid.3E_GET.29

Gerv
Apparently not - was just clicking the 0.9 api methods link from https://wiki.mozilla.org/Bugzilla:REST_API#Version_0.9_.282nd_February_2011.29 :-)
Yes - the docs for each version are frozen at the time it's shipped. Wikis don't do branching :-|

Gerv
Status: UNCONFIRMED → RESOLVED
Closed: 13 years ago13 years ago
Resolution: --- → FIXED
Product: Webtools → Webtools Graveyard
You need to log in before you can comment on or make changes to this bug.