TEXT   81

flagtype

Guest on 12th July 2022 03:28:30 PM

  1. Flag Types
  2. **********
  3.  
  4. This part of the Bugzilla API allows you to get and create bug and
  5. attachment flags.
  6.  
  7.  
  8. Get Flag Type
  9. =============
  10.  
  11. Get information about valid flag types that can be set for bugs and
  12. attachments.
  13.  
  14. **Request**
  15.  
  16. To get information about all flag types for a product:
  17.  
  18.    GET /rest/flag_type/(product)
  19.  
  20. To get information about flag_types for a product and component:
  21.  
  22.    GET /rest/flag_type/(product)/(component)
  23.  
  24.    {
  25.      "bug": [
  26.        {
  27.          "is_multiplicable": false,
  28.          "is_requesteeble": false,
  29.          "values": [
  30.            "X",
  31.            "?",
  32.            "+",
  33.            "-"
  34.          ],
  35.          "id": 11,
  36.          "type": "bug",
  37.          "is_active": true,
  38.          "description": "Blocks the next release",
  39.          "name": "blocker"
  40.        },
  41.        {
  42.          "is_requesteeble": false,
  43.          "is_multiplicable": false,
  44.          "is_active": true,
  45.          "description": "Regression found?",
  46.          "name": "regression",
  47.          "id": 10,
  48.          "type": "bug",
  49.          "values": [
  50.            "X",
  51.            "?",
  52.            "+",
  53.            "-"
  54.          ]
  55.        },
  56.      ],
  57.      "attachment": [
  58.        {
  59.          "is_requesteeble": true,
  60.          "is_multiplicable": true,
  61.          "name": "review",
  62.          "is_active": true,
  63.          "description": "Review the patch for correctness and applicability to the problem.",
  64.          "type": "attachment",
  65.          "id": 1,
  66.          "values": [
  67.            "X",
  68.            "?",
  69.            "+",
  70.            "-"
  71.          ]
  72.        },
  73.        {
  74.          "name": "approval",
  75.          "description": "Approve the patch for check-in to the tree.",
  76.          "is_active": true,
  77.          "values": [
  78.            "X",
  79.            "?",
  80.            "+",
  81.            "-"
  82.          ],
  83.          "type": "attachment",
  84.          "id": 3,
  85.          "is_multiplicable": false,
  86.          "is_requesteeble": false
  87.        }
  88.      ]
  89.    }
  90.  
  91. You must pass a product name and an optional component name. If the
  92. product or component names contains a "/" character, up will need to
  93. url encode it.
  94.  
  95. +-------------+--------+--------------------------------------------------------------+
  96. | name        | type   | description                                                  |
  97. +=============+========+==============================================================+
  98. | **product** | string | The name of a valid product.                                 |
  99. +-------------+--------+--------------------------------------------------------------+
  100. | component   | string | An optional valid component name associated with the         |
  101. |             |        | product.                                                     |
  102. +-------------+--------+--------------------------------------------------------------+
  103.  
  104. **Response**
  105.  
  106. An object containing two items, "bug" and "attachment". Each value is
  107. an array of objects, containing the following items:
  108.  
  109. +------------------+---------+--------------------------------------------------------+
  110. | name             | type    | description                                            |
  111. +==================+=========+========================================================+
  112. | id               | int     | An integer ID uniquely identifying this flag type.     |
  113. +------------------+---------+--------------------------------------------------------+
  114. | name             | string  | The name for the flag type.                            |
  115. +------------------+---------+--------------------------------------------------------+
  116. | type             | string  | The target of the flag type which is either "bug" or   |
  117. |                  |         | "attachment".                                          |
  118. +------------------+---------+--------------------------------------------------------+
  119. | description      | string  | The description of the flag type.                      |
  120. +------------------+---------+--------------------------------------------------------+
  121. | values           | array   | String values that the user can set on the flag type.  |
  122. +------------------+---------+--------------------------------------------------------+
  123. | is_requesteeble  | boolean | Users can ask specific other users to set flags of     |
  124. |                  |         | this type.                                             |
  125. +------------------+---------+--------------------------------------------------------+
  126. | is_multiplicable | boolean | Multiple flags of this type can be set for the same    |
  127. |                  |         | bug or attachment.                                     |
  128. +------------------+---------+--------------------------------------------------------+
  129.  
  130.  
  131. Create Flag Type
  132. ================
  133.  
  134. Create a new flag type. You must be authenticated and be in the
  135. *editcomponents* group to perform this action.
  136.  
  137. **Request**
  138.  
  139.    POST /rest/flag_type
  140.  
  141.    {
  142.      "name" : "feedback",
  143.      "description" : "This attachment needs feedback",
  144.      "inclusions" : [ "WorldControl "],
  145.      "target_type" : "attachment"
  146.    }
  147.  
  148. Some params must be set, or an error will be thrown. The required
  149. params are marked in **bold**.
  150.  
  151. +-----------------------------+---------+---------------------------------------------+
  152. | name                        | type    | description                                 |
  153. +=============================+=========+=============================================+
  154. | **name**                    | string  | The name of the new flag type.              |
  155. +-----------------------------+---------+---------------------------------------------+
  156. | **description**             | string  | A description for the flag type.            |
  157. +-----------------------------+---------+---------------------------------------------+
  158. | target_type                 | string  | The new flag is either for a "bug" or an    |
  159. |                             |         | "attachment".                               |
  160. +-----------------------------+---------+---------------------------------------------+
  161. | inclusions                  | array   | An array of strings or an object containing |
  162. |                             |         | product names, and optionally component     |
  163. |                             |         | names. If you provide a string, the flag    |
  164. |                             |         | type will be shown on all bugs in that      |
  165. |                             |         | product. If you provide an object, the key  |
  166. |                             |         | represents the product name, and the value  |
  167. |                             |         | is the components of the product to be      |
  168. |                             |         | included.                                   |
  169. +-----------------------------+---------+---------------------------------------------+
  170. | exclusions                  | array   | An array of strings or an object containing |
  171. |                             |         | product names. This uses the same format as |
  172. |                             |         | "inclusions". This will exclude the flag    |
  173. |                             |         | from all products and components specified. |
  174. +-----------------------------+---------+---------------------------------------------+
  175. | sortkey                     | int     | A number between 1 and 32767 by which this  |
  176. |                             |         | type will be sorted when displayed to users |
  177. |                             |         | in a list; ignore if you don't care what    |
  178. |                             |         | order the types appear in or if you want    |
  179. |                             |         | them to appear in alphabetical order.       |
  180. +-----------------------------+---------+---------------------------------------------+
  181. | is_active                   | boolean | Flag of this type appear in the UI and can  |
  182. |                             |         | be set. Default is "true".                  |
  183. +-----------------------------+---------+---------------------------------------------+
  184. | is_requestable              | boolean | Users can ask for flags of this type to be  |
  185. |                             |         | set. Default is "true".                     |
  186. +-----------------------------+---------+---------------------------------------------+
  187. | cc_list                     | array   | If the flag type is requestable, who should |
  188. |                             |         | receive e-mail notification of requests.    |
  189. |                             |         | This is an array of e-mail addresses        |
  190. |                             |         | whichdo not need to be Bugzilla logins.     |
  191. +-----------------------------+---------+---------------------------------------------+
  192. | is_specifically_requestable | boolean | Users can ask specific other users to set   |
  193. |                             |         | flags of this type as opposed to just       |
  194. |                             |         | asking the wind. Default is "true".         |
  195. +-----------------------------+---------+---------------------------------------------+
  196. | is_multiplicable            | boolean | Multiple flags of this type can be set on   |
  197. |                             |         | the same bug. Default is "true".            |
  198. +-----------------------------+---------+---------------------------------------------+
  199. | grant_group                 | string  | The group allowed to grant/deny flags of    |
  200. |                             |         | this type (to allow all users to grant/deny |
  201. |                             |         | these flags, select no group). Default is   |
  202. |                             |         | no group.                                   |
  203. +-----------------------------+---------+---------------------------------------------+
  204. | request_group               | string  | If flags of this type are requestable, the  |
  205. |                             |         | group allowed to request them (to allow all |
  206. |                             |         | users to request these flags, select no     |
  207. |                             |         | group). Note that the request group alone   |
  208. |                             |         | has no effect if the grant group is not     |
  209. |                             |         | defined! Default is no group.               |
  210. +-----------------------------+---------+---------------------------------------------+
  211.  
  212. An example for "inclusions" and/or "exclusions":
  213.  
  214.    [
  215.      "FooProduct"
  216.    ]
  217.  
  218.    {
  219.      "BarProduct" : [ "C1", "C3" ],
  220.      "BazProduct" : [ "C7" ]
  221.    }
  222.  
  223. This flag will be added to **all** components of "FooProduct",
  224. components C1 and C3 of "BarProduct", and C7 of "BazProduct".
  225.  
  226. **Response**
  227.  
  228.    {
  229.      "id": 13
  230.    }
  231.  
  232. +---------+------+------------------------------------------------+
  233. | name    | type | description                                    |
  234. +=========+======+================================================+
  235. | flag_id | int  | ID of the new FlagType object is returned.     |
  236. +---------+------+------------------------------------------------+
  237.  
  238.  
  239. Update Flag Type
  240. ================
  241.  
  242. This allows you to update a flag type in Bugzilla. You must be
  243. authenticated and be in the *editcomponents* group to perform this
  244. action.
  245.  
  246. **Request**
  247.  
  248.    PUT /rest/flag_type/(id_or_name)
  249.  
  250.    {
  251.      "ids" : [13],
  252.      "name" : "feedback-new",
  253.      "is_requestable" : false
  254.    }
  255.  
  256. You can edit a single flag type by passing the ID or name of the flag
  257. type in the URL. To edit more than one flag type, you can specify
  258. addition IDs or flag type names using the "ids" or "names" parameters
  259. respectively.
  260.  
  261. One of the below must be specified.
  262.  
  263. +----------------+-------+------------------------------------------------------------+
  264. | name           | type  | description                                                |
  265. +================+=======+============================================================+
  266. | **id_or_name** | mixed | Integer flag type ID or name.                              |
  267. +----------------+-------+------------------------------------------------------------+
  268. | **ids**        | array | Numeric IDs of the flag types that you wish to update.     |
  269. +----------------+-------+------------------------------------------------------------+
  270. | **names**      | array | Names of the flag types that you wish to update. If many   |
  271. |                |       | flag types have the same name, this will change **all** of |
  272. |                |       | them.                                                      |
  273. +----------------+-------+------------------------------------------------------------+
  274.  
  275. The following parameters specify the new values you want to set for
  276. the flag types you are updating.
  277.  
  278. +-----------------------------+---------+---------------------------------------------+
  279. | name                        | type    | description                                 |
  280. +=============================+=========+=============================================+
  281. | name                        | string  | A short name identifying this type.         |
  282. +-----------------------------+---------+---------------------------------------------+
  283. | description                 | string  | A comprehensive description of this type.   |
  284. +-----------------------------+---------+---------------------------------------------+
  285. | inclusions                  | array   | An array of strings or an object containing |
  286. |                             |         | product names, and optionally component     |
  287. |                             |         | names. If you provide a string, the flag    |
  288. |                             |         | type will be shown on all bugs in that      |
  289. |                             |         | product. If you provide an object, the key  |
  290. |                             |         | represents the product name, and the value  |
  291. |                             |         | is the components of the product to be      |
  292. |                             |         | included.                                   |
  293. +-----------------------------+---------+---------------------------------------------+
  294. | exclusions                  | array   | An array of strings or an object containing |
  295. |                             |         | product names. This uses the same format as |
  296. |                             |         | "inclusions". This will exclude the flag    |
  297. |                             |         | from all products and components specified. |
  298. +-----------------------------+---------+---------------------------------------------+
  299. | sortkey                     | int     | A number between 1 and 32767 by which this  |
  300. |                             |         | type will be sorted when displayed to users |
  301. |                             |         | in a list; ignore if you don't care what    |
  302. |                             |         | order the types appear in or if you want    |
  303. |                             |         | them to appear in alphabetical order.       |
  304. +-----------------------------+---------+---------------------------------------------+
  305. | is_active                   | boolean | Flag of this type appear in the UI and can  |
  306. |                             |         | be set.                                     |
  307. +-----------------------------+---------+---------------------------------------------+
  308. | is_requestable              | boolean | Users can ask for flags of this type to be  |
  309. |                             |         | set.                                        |
  310. +-----------------------------+---------+---------------------------------------------+
  311. | cc_list                     | array   | If the flag type is requestable, who should |
  312. |                             |         | receive e-mail notification of requests.    |
  313. |                             |         | This is an array of e-mail addresses which  |
  314. |                             |         | do not need to be Bugzilla logins.          |
  315. +-----------------------------+---------+---------------------------------------------+
  316. | is_specifically_requestable | boolean | Users can ask specific other users to set   |
  317. |                             |         | flags of this type as opposed to just       |
  318. |                             |         | asking the wind.                            |
  319. +-----------------------------+---------+---------------------------------------------+
  320. | is_multiplicable            | boolean | Multiple flags of this type can be set on   |
  321. |                             |         | the same bug.                               |
  322. +-----------------------------+---------+---------------------------------------------+
  323. | grant_group                 | string  | The group allowed to grant/deny flags of    |
  324. |                             |         | this type (to allow all users to grant/deny |
  325. |                             |         | these flags, select no group).              |
  326. +-----------------------------+---------+---------------------------------------------+
  327. | request_group               | string  | If flags of this type are requestable, the  |
  328. |                             |         | group allowed to request them (to allow all |
  329. |                             |         | users to request these flags, select no     |
  330. |                             |         | group). Note that the request group alone   |
  331. |                             |         | has no effect if the grant group is not     |
  332. |                             |         | defined!                                    |
  333. +-----------------------------+---------+---------------------------------------------+
  334.  
  335. An example for "inclusions" and/or "exclusions":
  336.  
  337.    [
  338.      "FooProduct",
  339.    ]
  340.  
  341.    {
  342.      "BarProduct" : [ "C1", "C3" ],
  343.      "BazProduct" : [ "C7" ]
  344.    }
  345.  
  346. This flag will be added to **all** components of "FooProduct",
  347. components C1 and C3 of "BarProduct", and C7 of "BazProduct".
  348.  
  349. **Response**
  350.  
  351.    {
  352.      "flagtypes": [
  353.        {
  354.          "name": "feedback-new",
  355.          "changes": {
  356.            "is_requestable": {
  357.              "added": "0",
  358.              "removed": "1"
  359.            },
  360.            "name": {
  361.              "removed": "feedback",
  362.              "added": "feedback-new"
  363.            }
  364.          },
  365.          "id": 13
  366.        }
  367.      ]
  368.    }
  369.  
  370. "flagtypes" (array) Flag change objects containing the following
  371. items:
  372.  
  373. +---------+--------+------------------------------------------------------------------+
  374. | name    | type   | description                                                      |
  375. +=========+========+==================================================================+
  376. | id      | int    | The ID of the flag type that was updated.                        |
  377. +---------+--------+------------------------------------------------------------------+
  378. | name    | string | The name of the flag type that was updated.                      |
  379. +---------+--------+------------------------------------------------------------------+
  380. | changes | object | The changes that were actually done on this flag type. The keys  |
  381. |         |        | are the names of the fields that were changed, and the values    |
  382. |         |        | are an object with two items:  * added: (string) The value that  |
  383. |         |        | this field was changed to.  * removed: (string) The value that   |
  384. |         |        | was previously set in this field.                                |
  385. +---------+--------+------------------------------------------------------------------+
  386.  
  387. Booleans changes will be represented with the strings '1' and '0'.
  388.  
  389. ======================================================================
  390.  
  391. This documentation undoubtedly has bugs; if you find some, please file
  392. them here.

Raw Paste


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