TEXT   89

group

Guest on 12th July 2022 03:29:46 PM

  1. Groups
  2. ******
  3.  
  4. The API for creating, changing, and getting information about groups.
  5.  
  6.  
  7. Create Group
  8. ============
  9.  
  10. This allows you to create a new group in Bugzilla. You must be
  11. authenticated and be in the *creategroups* group to perform this
  12. action.
  13.  
  14. **Request**
  15.  
  16.    POST /rest/group
  17.  
  18.    {
  19.      "name" : "secret-group",
  20.      "description" : "Too secret for you!",
  21.      "is_active" : true
  22.    }
  23.  
  24. Some params must be set, or an error will be thrown. The required
  25. params are marked in **bold**.
  26.  
  27. +-----------------+---------+---------------------------------------------------------+
  28. | name            | type    | description                                             |
  29. +=================+=========+=========================================================+
  30. | **name**        | string  | A short name for this group. Must be unique. This is    |
  31. |                 |         | not usually displayed in the user interface, except in  |
  32. |                 |         | a few places.                                           |
  33. +-----------------+---------+---------------------------------------------------------+
  34. | **description** | string  | A human-readable name for this group. Should be         |
  35. |                 |         | relatively short. This is what will normally appear in  |
  36. |                 |         | the UI as the name of the group.                        |
  37. +-----------------+---------+---------------------------------------------------------+
  38. | user_regexp     | string  | A regular expression. Any user whose Bugzilla username  |
  39. |                 |         | matches this regular expression will automatically be   |
  40. |                 |         | granted membership in this group.                       |
  41. +-----------------+---------+---------------------------------------------------------+
  42. | is_active       | boolean | "true" if new group can be used for bugs, "false" if    |
  43. |                 |         | this is a group that will only contain users and no     |
  44. |                 |         | bugs will be restricted to it.                          |
  45. +-----------------+---------+---------------------------------------------------------+
  46. | icon_url        | string  | A URL pointing to a small icon used to identify the     |
  47. |                 |         | group. This icon will show up next to users' names in   |
  48. |                 |         | various parts of Bugzilla if they are in this group.    |
  49. +-----------------+---------+---------------------------------------------------------+
  50.  
  51. **Response**
  52.  
  53.    {
  54.      "id": 22
  55.    }
  56.  
  57. +------+------+--------------------------------+
  58. | name | type | description                    |
  59. +======+======+================================+
  60. | id   | int  | ID of the newly-created group. |
  61. +------+------+--------------------------------+
  62.  
  63.  
  64. Update Group
  65. ============
  66.  
  67. This allows you to update a group in Bugzilla. You must be
  68. authenticated and be in the *creategroups* group to perform this
  69. action.
  70.  
  71. **Request**
  72.  
  73. To update a group using the group ID or name:
  74.  
  75.    PUT /rest/group/(id_or_name)
  76.  
  77.    {
  78.      "name" : "secret-group",
  79.      "description" : "Too secret for you! (updated description)",
  80.      "is_active" : false
  81.    }
  82.  
  83. You can edit a single group by passing the ID or name of the group in
  84. the URL. To edit more than one group, you can specify addition IDs or
  85. group names using the "ids" or "names" parameters respectively.
  86.  
  87. One of the below must be specified.
  88.  
  89. +----------------+-------+------------------------------------------------------------+
  90. | name           | type  | description                                                |
  91. +================+=======+============================================================+
  92. | **id_or_name** | mixed | Integer group or name.                                     |
  93. +----------------+-------+------------------------------------------------------------+
  94. | **ids**        | array | IDs of groups to update.                                   |
  95. +----------------+-------+------------------------------------------------------------+
  96. | **names**      | array | Names of groups to update.                                 |
  97. +----------------+-------+------------------------------------------------------------+
  98.  
  99. The following parameters specify the new values you want to set for
  100. the group(s) you are updating.
  101.  
  102. +-------------+---------+-------------------------------------------------------------+
  103. | name        | type    | description                                                 |
  104. +=============+=========+=============================================================+
  105. | name        | string  | A new name for the groups. If you try to set this while     |
  106. |             |         | updating more than one group, an error will occur, as group |
  107. |             |         | names must be unique.                                       |
  108. +-------------+---------+-------------------------------------------------------------+
  109. | description | string  | A new description for the groups. This is what will appear  |
  110. |             |         | in the UI as the name of the groups.                        |
  111. +-------------+---------+-------------------------------------------------------------+
  112. | user_regexp | string  | A new regular expression for email. Will automatically      |
  113. |             |         | grant membership to these groups to anyone with an email    |
  114. |             |         | address that matches this perl regular expression.          |
  115. +-------------+---------+-------------------------------------------------------------+
  116. | is_active   | boolean | Set if groups are active and eligible to be used for bugs.  |
  117. |             |         | "true" if bugs can be restricted to this group, "false"     |
  118. |             |         | otherwise.                                                  |
  119. +-------------+---------+-------------------------------------------------------------+
  120. | icon_url    | string  | A URL pointing to an icon that will appear next to the name |
  121. |             |         | of users who are in this group.                             |
  122. +-------------+---------+-------------------------------------------------------------+
  123.  
  124. **Response**
  125.  
  126.    {
  127.      "groups": [
  128.        {
  129.          "changes": {
  130.            "description": {
  131.              "added": "Too secret for you! (updated description)",
  132.              "removed": "Too secret for you!"
  133.            },
  134.            "is_active": {
  135.              "removed": "1",
  136.              "added": "0"
  137.            }
  138.          },
  139.          "id": "22"
  140.        }
  141.      ]
  142.    }
  143.  
  144. "groups" (array) Group change objects, each containing the following
  145. items:
  146.  
  147. +---------+--------+------------------------------------------------------------------+
  148. | name    | type   | description                                                      |
  149. +=========+========+==================================================================+
  150. | id      | int    | The ID of the group that was updated.                            |
  151. +---------+--------+------------------------------------------------------------------+
  152. | changes | object | The changes that were actually done on this group. The keys are  |
  153. |         |        | the names of the fields that were changed, and the values are an |
  154. |         |        | object with two items:  * added: (string) The values that were   |
  155. |         |        | added to this field, possibly a comma-and-space-separated list   |
  156. |         |        | if multiple values were added.  * removed: (string) The values   |
  157. |         |        | that were removed from this field, possibly a comma-and-space-   |
  158. |         |        | separated list if multiple values were removed.                  |
  159. +---------+--------+------------------------------------------------------------------+
  160.  
  161.  
  162. Get Group
  163. =========
  164.  
  165. Returns information about Bugzilla groups.
  166.  
  167. **Request**
  168.  
  169. To return information about a specific group ID or name:
  170.  
  171.    GET /rest/group/(id_or_name)
  172.  
  173. You can also return information about more than one specific group by
  174. using the following in your query string:
  175.  
  176.    GET /rest/group?ids=1&ids=2&ids=3
  177.    GET /group?names=ProductOne&names=Product2
  178.  
  179. If neither IDs nor names are passed, and you are in the creategroups
  180. or editusers group, then all groups will be retrieved. Otherwise, only
  181. groups that you have bless privileges for will be returned.
  182.  
  183. +------------+---------+--------------------------------------------------------------+
  184. | name       | type    | description                                                  |
  185. +============+=========+==============================================================+
  186. | id_or_name | mixed   | Integer group ID or name.                                    |
  187. +------------+---------+--------------------------------------------------------------+
  188. | ids        | array   | Integer IDs of groups.                                       |
  189. +------------+---------+--------------------------------------------------------------+
  190. | names      | array   | Names of groups.                                             |
  191. +------------+---------+--------------------------------------------------------------+
  192. | membership | boolean | Set to 1 then a list of members of the passed groups names   |
  193. |            |         | and IDs will be returned.                                    |
  194. +------------+---------+--------------------------------------------------------------+
  195.  
  196. **Response**
  197.  
  198.    {
  199.      "groups": [
  200.        {
  201.          "membership": [
  202.            {
  203.              "real_name": "Bugzilla User",
  204.              "can_login": true,
  205.              "name": "user@bugzilla.org",
  206.              "login_denied_text": "",
  207.              "id": 85,
  208.              "email_enabled": false,
  209.              "email": "user@bugzilla.org"
  210.            },
  211.          ],
  212.          "is_active": true,
  213.          "description": "Test Group",
  214.          "user_regexp": "",
  215.          "is_bug_group": true,
  216.          "name": "TestGroup",
  217.          "id": 9
  218.        }
  219.      ]
  220.    }
  221.  
  222. If the user is a member of the *creategroups* group they will receive
  223. information about all groups or groups matching the criteria that they
  224. passed. You have to be in the creategroups group unless you're
  225. requesting membership information.
  226.  
  227. If the user is not a member of the *creategroups* group, but they are
  228. in the "editusers" group or have bless privileges to the groups they
  229. require membership information for, the is_active, is_bug_group and
  230. user_regexp values are not supplied.
  231.  
  232. The return value will be an object containing group names as the keys;
  233. each value will be an object that describes the group and has the
  234. following items:
  235.  
  236. +--------------+--------+-------------------------------------------------------------+
  237. | name         | type   | description                                                 |
  238. +==============+========+=============================================================+
  239. | id           | int    | The unique integer ID that Bugzilla uses to identify this   |
  240. |              |        | group. Even if the name of the group changes, this ID will  |
  241. |              |        | stay the same.                                              |
  242. +--------------+--------+-------------------------------------------------------------+
  243. | name         | string | The name of the group.                                      |
  244. +--------------+--------+-------------------------------------------------------------+
  245. | description  | string | The description of the group.                               |
  246. +--------------+--------+-------------------------------------------------------------+
  247. | is_bug_group | int    | Whether this group is to be used for bug reports or is only |
  248. |              |        | administrative specific.                                    |
  249. +--------------+--------+-------------------------------------------------------------+
  250. | user_regexp  | string | A regular expression that allows users to be added to this  |
  251. |              |        | group if their login matches.                               |
  252. +--------------+--------+-------------------------------------------------------------+
  253. | is_active    | int    | Whether this group is currently active or not.              |
  254. +--------------+--------+-------------------------------------------------------------+
  255. | users        | array  | User objects that are members of this group; only returned  |
  256. |              |        | if the user sets the "membership" parameter to 1. Each user |
  257. |              |        | object has the items describe in the User object below.     |
  258. +--------------+--------+-------------------------------------------------------------+
  259.  
  260. User object:
  261.  
  262. +---------------+---------+-----------------------------------------------------------+
  263. | name          | type    | description                                               |
  264. +===============+=========+===========================================================+
  265. | id            | int     | The ID of the user.                                       |
  266. +---------------+---------+-----------------------------------------------------------+
  267. | real_name     | string  | The actual name of the user.                              |
  268. +---------------+---------+-----------------------------------------------------------+
  269. | email         | string  | The email address of the user.                            |
  270. +---------------+---------+-----------------------------------------------------------+
  271. | name          | string  | The login name of the user. Note that in some situations  |
  272. |               |         | this is different than their email.                       |
  273. +---------------+---------+-----------------------------------------------------------+
  274. | can_login     | boolean | A boolean value to indicate if the user can login into    |
  275. |               |         | bugzilla.                                                 |
  276. +---------------+---------+-----------------------------------------------------------+
  277. | email_enabled | boolean | A boolean value to indicate if bug-related mail will be   |
  278. |               |         | sent to the user or not.                                  |
  279. +---------------+---------+-----------------------------------------------------------+
  280. | disabled_text | string  | A text field that holds the reason for disabling a user   |
  281. |               |         | from logging into Bugzilla. If empty, then the user       |
  282. |               |         | account is enabled; otherwise it is disabled/closed.      |
  283. +---------------+---------+-----------------------------------------------------------+
  284.  
  285. ======================================================================
  286.  
  287. This documentation undoubtedly has bugs; if you find some, please file
  288. them here.

Raw Paste


Login or Register to edit or fork this paste. It's free.