Rest Projects » History » Version 35
Jan Catrysse, 2021-11-16 17:59
Updated the information about project custom_field_values
| 1 | 1 | Jean-Philippe Lang | h1. Projects |
|---|---|---|---|
| 2 | |||
| 3 | 21 | yuya ito | {{>toc}} |
| 4 | |||
| 5 | 1 | Jean-Philippe Lang | h2. Listing projects |
| 6 | |||
| 7 | GET /projects.xml |
||
| 8 | |||
| 9 | 18 | Jaroslav Balaz | Returns all projects (all public projects and private projects where user have access to) |
| 10 | 1 | Jean-Philippe Lang | |
| 11 | 17 | Jean-Baptiste Barth | +Parameters+: |
| 12 | |||
| 13 | * @include@: fetch associated data (optional). Possible values: trackers, issue_categories, enabled_modules (since 2.6.0). Values should be separated by a comma ",". |
||
| 14 | |||
| 15 | 1 | Jean-Philippe Lang | +Response+: |
| 16 | |||
| 17 | 24 | Toshi MARUYAMA | <pre><code class="xml"> |
| 18 | 1 | Jean-Philippe Lang | <projects type="array"> |
| 19 | 3 | Christoph Witzany | <project> |
| 20 | <id>1</id> |
||
| 21 | 13 | Terence Mill | <name>Redmine</name> |
| 22 | <identifier>redmine</identifier> |
||
| 23 | 1 | Jean-Philippe Lang | <description> |
| 24 | 13 | Terence Mill | Redmine is a flexible project management web application written using Ruby on Rails framework. |
| 25 | 1 | Jean-Philippe Lang | </description> |
| 26 | <created_on>Sat Sep 29 12:03:04 +0200 2007</created_on> |
||
| 27 | <updated_on>Sun Mar 15 12:35:11 +0100 2009</updated_on> |
||
| 28 | 14 | Jean-Baptiste Barth | <is_public>true</is_public> |
| 29 | 1 | Jean-Philippe Lang | </project> |
| 30 | 3 | Christoph Witzany | <project> |
| 31 | <id>2</id> |
||
| 32 | 1 | Jean-Philippe Lang | ... |
| 33 | </project> |
||
| 34 | 24 | Toshi MARUYAMA | </code></pre> |
| 35 | 1 | Jean-Philippe Lang | |
| 36 | 14 | Jean-Baptiste Barth | +Notes+: |
| 37 | * @is_public@ is exposed since 2.6.0 |
||
| 38 | |||
| 39 | 1 | Jean-Philippe Lang | h2. Showing a project |
| 40 | |||
| 41 | GET /projects/[id].xml |
||
| 42 | |||
| 43 | Returns the project of given id or identifier. |
||
| 44 | |||
| 45 | 9 | Jean-Philippe Lang | +Parameters+: |
| 46 | |||
| 47 | 22 | Go MAEDA | * @include@: fetch associated data (optional). Possible values: trackers, issue_categories, enabled_modules (since 2.6.0), time_entry_activities (since 3.4.0). Values should be separated by a comma ",". |
| 48 | 9 | Jean-Philippe Lang | |
| 49 | 1 | Jean-Philippe Lang | +Examples+: |
| 50 | |||
| 51 | <pre> |
||
| 52 | GET /projects/12.xml |
||
| 53 | 10 | Jean-Philippe Lang | GET /projects/12.xml?include=trackers |
| 54 | 1 | Jean-Philippe Lang | GET /projects/12.xml?include=trackers,issue_categories |
| 55 | 15 | Jean-Baptiste Barth | GET /projects/12.xml?include=enabled_modules |
| 56 | 13 | Terence Mill | GET /projects/redmine.xml |
| 57 | 1 | Jean-Philippe Lang | </pre> |
| 58 | |||
| 59 | +Response+: |
||
| 60 | |||
| 61 | 24 | Toshi MARUYAMA | <pre><code class="xml"> |
| 62 | 1 | Jean-Philippe Lang | <?xml version="1.0" encoding="UTF-8"?> |
| 63 | <project id="1"> |
||
| 64 | 13 | Terence Mill | <name>Redmine</name> |
| 65 | <identifier>redmine</identifier> |
||
| 66 | 1 | Jean-Philippe Lang | <description> |
| 67 | 13 | Terence Mill | Redmine is a flexible project management web application written using Ruby on Rails framework. |
| 68 | 1 | Jean-Philippe Lang | </description> |
| 69 | <homepage></homepage> |
||
| 70 | 32 | Marius BĂLTEANU | <status>1</status> |
| 71 | 28 | Go MAEDA | <parent id="123" name="foo"/> |
| 72 | 31 | Marius BĂLTEANU | <default_version id="3" name="2.0"/> |
| 73 | <default_assignee id="2" name="John Smith"/> |
||
| 74 | 1 | Jean-Philippe Lang | <created_on>Sat Sep 29 12:03:04 +0200 2007</created_on> |
| 75 | <updated_on>Sun Mar 15 12:35:11 +0100 2009</updated_on> |
||
| 76 | 14 | Jean-Baptiste Barth | <is_public>true</is_public> |
| 77 | 1 | Jean-Philippe Lang | </project> |
| 78 | 24 | Toshi MARUYAMA | </code></pre> |
| 79 | 1 | Jean-Philippe Lang | |
| 80 | 14 | Jean-Baptiste Barth | +Notes+: |
| 81 | * @is_public@ is exposed since 2.6.0 |
||
| 82 | 1 | Jean-Philippe Lang | |
| 83 | h2. Creating a project |
||
| 84 | |||
| 85 | POST /projects.xml |
||
| 86 | |||
| 87 | Creates a the project. |
||
| 88 | |||
| 89 | +Parameters+: |
||
| 90 | |||
| 91 | * @project@ (required): a hash of the project attributes, including: |
||
| 92 | |||
| 93 | * @name@ (required): the project name |
||
| 94 | * @identifier@ (required): the project identifier |
||
| 95 | * @description@ |
||
| 96 | 20 | Lucile Quirion | * @homepage@ |
| 97 | * @is_public@: true or false |
||
| 98 | * @parent_id@: the parent project number |
||
| 99 | * @inherit_members@: true or false |
||
| 100 | 33 | Marius BĂLTEANU | * @default_assigned_to_id@: ID of the default user. It works only when the new project is a subproject and it inherits the members. |
| 101 | * @default_version_id@: ID of the default version. It works only with existing shared versions. |
||
| 102 | 20 | Lucile Quirion | * @tracker_ids@: (repeatable element) the tracker id: 1 for Bug, etc. |
| 103 | 1 | Jean-Philippe Lang | * @enabled_module_names@: (repeatable element) the module name: boards, calendar, documents, files, gantt, issue_tracking, news, repository, time_tracking, wiki. |
| 104 | 27 | Igor Rybak | * @issue_custom_field_ids@: (repeatable element) issue custom field id. |
| 105 | 35 | Jan Catrysse | * @custom_field_values@: array with @id => value@ pairs |
| 106 | 1 | Jean-Philippe Lang | |
| 107 | <pre> |
||
| 108 | POST /projects.xml |
||
| 109 | 24 | Toshi MARUYAMA | </pre> |
| 110 | |||
| 111 | 25 | Toshi MARUYAMA | <pre><code class="xml"> |
| 112 | 26 | Mayama Takeshi | <project> |
| 113 | <name>test project</name> |
||
| 114 | <identifier>test</identifier> |
||
| 115 | <enabled_module_names>time_tracking</enabled_module_names> |
||
| 116 | <enabled_module_names>issue_tracking</enabled_module_names> |
||
| 117 | </project> |
||
| 118 | 35 | Jan Catrysse | </code></pre> |
| 119 | |||
| 120 | <pre> |
||
| 121 | POST /projects.json |
||
| 122 | </pre> |
||
| 123 | |||
| 124 | <pre><code class="json"> |
||
| 125 | { |
||
| 126 | "project": { |
||
| 127 | "name": "Example", |
||
| 128 | "identifier": "Example", |
||
| 129 | "description": "Example", |
||
| 130 | "is_public": false, |
||
| 131 | "parent_id": 7, |
||
| 132 | "inherit_members": false, |
||
| 133 | "custom_field_values": { |
||
| 134 | 8: "Value" |
||
| 135 | } |
||
| 136 | } |
||
| 137 | } |
||
| 138 | 25 | Toshi MARUYAMA | </code></pre> |
| 139 | 1 | Jean-Philippe Lang | |
| 140 | +Response+: |
||
| 141 | |||
| 142 | * @201 Created@: project was created |
||
| 143 | * @422 Unprocessable Entity@: project was not created due to validation failures (response body contains the error messages) |
||
| 144 | |||
| 145 | h2. Updating a project |
||
| 146 | |||
| 147 | PUT /projects/[id].xml |
||
| 148 | |||
| 149 | Updates the project of given id or identifier. |
||
| 150 | |||
| 151 | 34 | Go MAEDA | h2. Archiving a project |
| 152 | |||
| 153 | PUT /projects/[id]/archive.xml |
||
| 154 | |||
| 155 | Archives the project of given id or identifier. Available since Redmine 5.0. |
||
| 156 | |||
| 157 | h2. Unarchiving a project |
||
| 158 | |||
| 159 | PUT /projects/[id]/unarchive.xml |
||
| 160 | |||
| 161 | Unrchives the project of given id or identifier. Available since Redmine 5.0. |
||
| 162 | |||
| 163 | 1 | Jean-Philippe Lang | h2. Deleting a project |
| 164 | |||
| 165 | DELETE /projects/[id].xml |
||
| 166 | |||
| 167 | Deletes the project of given id or identifier. |
||
| 168 | 11 | Wim Bertels | |
| 169 | h2. Limitations: |
||
| 170 | |||
| 171 | 23 | Toshi MARUYAMA | A POST request on Redmine 1.0.1-2 (Debian stable) does not work using the API key, but does work with a login/passwd authentication |
| 172 | #12104 |