REST API Create User full_name vs Get User real_name in 5.2 documentation

David Miller justdave at bugzilla.org
Wed Mar 5 12:13:33 UTC 2025


I would consider this a bug.  The same item should have the same name 
anywhere it's used.  The one currently getting returned in the responses 
(real_name) should be the one we keep, because we can make both work for 
create/update, but you can only have one for the response, and changing 
it will break people that are using it already.


I filed https://bugzilla.mozilla.org/show_bug.cgi?id=1951920


On 3/5/25 12:35 AM, Carlo Barrientos wrote:
> In the 5.2  REST API  Get User, the JSON response uses key "real_name" 
> (which shows up in the Administrators -> Users GUI in a column named 
> "Real Name")
> But if "real_name" is used in JSON data for the REST API Create User , 
> the Create User ignores the "real_name" because it requires 
> "full_name" to populate the "Real Name" column in the Administrator -> 
> Users search output;
> Is that intentional?  Because it makes copying a user from one 
> bugzilla to another more difficult using the API because you have to 
> map full_name to real_name depending on which User API you are using.
> At the very least,* the documentation should have a note about the 
> different JSON keys for the same thing.*
>
>  *
>     *Carlo*
>
> 6.1.13.4. Create User 
> <https://bugzilla.readthedocs.io/en/5.2/api/core/v1/user.html#create-user>
> Creates a user account directly in Bugzilla, password and all. Instead 
> of this, you should use Offer Account by Email when possible because 
> that makes sure that the email address specified can actually receive 
> an email. This function does not check that. You must be authenticated 
> and be in the /editusers/ group to perform this action.
> *Request*
> POST /rest/user
> { "email" : "user at bugzilla.org", "*full_name*" : "Test User", 
> "password" : "K16ldRr922I1" }
> name
> 	
> type
> 	
> description
> email
> 	
> string
> 	
> The email address for the new user.
> full_name
> 	
> string
> 	
> The user’s full name. Will be set to empty if not specified.
>
> 6.1.13.6. Get User 
> <https://bugzilla.readthedocs.io/en/5.2/api/core/v1/user.html#get-user>
> Gets information about user accounts in Bugzilla.
> Request
> To get information about a single user in Bugzilla:
> GET /rest/user/(id_or_name)
> GET /rest/user?match=foo
> To get user by using an integer ID value or by using |match|, you must 
> be authenticated.
> name
> 	
> type
> 	
> description
> id_or_name
> 	
> mixed
> 	
> An integer user ID or login name of the user.
> ids
> 	
> array
> 	
> Integer user IDs. Logged=out users cannot pass this parameter to this 
> function. If they try, they will get an error. Logged=in users will 
> get an error if they specify the ID of a user they cannot see.
>
> Response
>
>      o
>         users: (array) Each object describes a user and has the
>         following items:
>
> name
> 	
> type
> 	
> description
> id
> 	
> int
> 	
> The unique integer ID that Bugzilla uses to represent this user. Even 
> if the user’s login name changes, this will not change.
> real_name
> 	
> string
> 	
> The actual name of the user. May be blank.
> email
> 	
> string
> 	
> The email address of the user.
> name
> 	
> string
> 	
> The login name of the user. Note that in some situations this is different
>
>     {"users":[
>         {"name":"carlobme at icloud.com",
>          "id":3,
>          "*real_name*":"Carlo iCloud",
>          "groups":[{"name":"bz_canusewhines","description":"User can
>     configure whine reports for
>     self","id":11},{"name":"editbugs","description":"Can edit all bug
>     fields","id":8}],
>          "can_login":true,
>          "email_enabled":true,
>          "login_denied_text":"",
>          "email":"carlobme at icloud.com"
>          }
>       ]
>     }
>
>       6.1.13.5. Update User 
> <https://bugzilla.readthedocs.io/en/5.2/api/core/v1/user.html#update-user>
> Updates an existing user account in Bugzilla. You must be 
> authenticated and be in the /editusers/group to perform this action.
> Request
> PUT /rest/user/(id_or_name)
> You can edit a single user by passing the ID or login name of the user 
> in the URL. To edit more than one user, you can specify addition IDs 
> or login names using the |ids| or |names| parameters respectively.
> name
> 	
> type
> 	
> description
> id_or_name
> 	
> mixed
> 	
> Either the ID or the login name of the user to update.
> ids
> 	
> array
> 	
> Additional IDs of users to update.
> names
> 	
> array
> 	
> Additional login names of users to update.
> full_name
> 	
> string
> 	
> The new name of the user.
>
>
>
>
> _______________________________________________
> support-list mailing list
> support-list at bugzilla.org
> https://lists.bugzilla.org/listinfo/support-list
-- 
[Bugzilla Logo] 	
*Dave Miller*
Project Leader
*Bugzilla Project*
https://bugzilla.org/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bugzilla.org/pipermail/support-list/attachments/20250305/cfed4e17/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: UTXUQG4UCKndnb3e.png
Type: image/png
Size: 7345 bytes
Desc: not available
URL: <http://lists.bugzilla.org/pipermail/support-list/attachments/20250305/cfed4e17/attachment-0001.png>


More information about the support-list mailing list