Open Bug 647652 Opened 13 years ago Updated 11 years ago

Bug.fields should only return fields that are returnable by Bug.get

Categories

(Bugzilla :: WebService, defect)

defect
Not set
normal

Tracking

()

People

(Reporter: konstantin.petrukhnov, Unassigned)

Details

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.15) Gecko/20110303 Firefox/3.6.15
Build Identifier: Bugzilla 4.0

Bug.fields return fields with names: 
bug_id, short_desc, bug_status, bug_severity

But Bug.get expect different names for same fields:
id, summary, status, severity

I think field names should be consistent for all return and send values.

Now WS.Bug.fields is almost unusable because of this bug.

Reproducible: Always
Bug.update and Bug.create and Bug.get uses same names, so most probably issue is with Bug.fields
This is true. We should probably have a separate field called "internal_name" for what we call it internally (which is what is being returned as "name" now).
Status: UNCONFIRMED → NEW
Ever confirmed: true
OS: Linux → All
Hardware: x86 → All
I have one more related issue:
It is possible to set "dupe_of" field trough XML-RPC, but this field is not exist if Bug.fields response. It should be added there.
(In reply to comment #3)
> I have one more related issue:
> It is possible to set "dupe_of" field trough XML-RPC, but this field is not
> exist if Bug.fields response. It should be added there.

You can set dupe_of now via XMLRPC Bug.update (as of 4.0 and maybe earlier)
and also you can get the current dupe_of value via Bug.get as well.

http://www.bugzilla.org/docs/4.0/en/html/api/Bugzilla/WebService/Bug.html

dkl
Yes, you just repeat my words, but you missed that "this field is not exist if Bug.fields response".
(In reply to comment #5)
> Yes, you just repeat my words, but you missed that "this field is not exist
> if Bug.fields response".

Apologies. I did in fact misread your comment and thought you were implying it was not possible to set dupe_of.

Yes it is true that dupe_of is not part of Bug.fields due to the way it is currently implemented. Bug.fields pulls the list of fields from a database table and dupe_of is not currently part of that table.

Bug.get is using returning a custom list of values for a bug report and has nothing to do with the same table of the database unfortunately.

It is possible that Bug.fields needs to be reworked in that it just returns the same possible fields that Bug.get returns as a client will not care about the extra field names from Bug.fields if they can't even possible be returned by Bug.get. Which is the reason for this bug.

dkl
Summary: inconsistent Bug.fields and Bug.get field names (XML-RPC) → Bug.fields should only return fields that are returnable by Bug.get
(In reply to comment #3)
> I have one more related issue:
> It is possible to set "dupe_of" field trough XML-RPC, but this field is not
> exist if Bug.fields response. It should be added there.

  Yeah, that's bug 568082.
You need to log in before you can comment on or make changes to this bug.