Rest Issues » History » Version 45

Version 44 (Jean-Philippe Lang, 2013-01-30 22:02) → Version 45/70 (Jean-Philippe Lang, 2013-01-30 22:15)

h1. Issues


h2. Listing issues

GET /issues.[format] /issues.xml

Returns a paginated list of issues. By default, it returns open issues only.


* @offset@: skip this number of issues in response (optional)
* @limit@: number of issues per page (optional)
* @sort@: column to sort with. Append @:desc@ to invert the order.

Optional filters:

* @project_id@: get issues from the project with the given id, where id is either project id or project identifier
* @subproject_id@: get issues from the subproject with the given id. You can use @project_id=XXX&subproject_id=!*@ to get only the issues of a given project and none of its subprojects.
* @tracker_id@: get issues from the tracker with the given id
* @status_id@: get issues with the given status id only. Possible values: @open@, @closed@, @*@ to get open and closed issues, status id
* @assigned_to_id@: get issues which are assigned to the given user id
* @cf_x@: get issues with the given value for custom field with an ID of @x@. (Custom field must have 'used as a filter' checked.)
* ...


GET /issues.xml
GET /issues.xml?project_id=2
GET /issues.xml?project_id=2&tracker_id=1
GET /issues.xml?assigned_to_id=6
GET /issues.xml?status_id=closed
GET /issues.xml?status_id=*
GET /issues.xml?cf_1=abcdef

Paging example:
GET /issues.xml?offset=0&limit=100 /issues.xml?project_id=testproject&amp;query_id=2&amp;offset=0&amp;limit=100
GET /issues.xml?offset=100&limit=100 /issues.xml?project_id=testproject&amp;query_id=2&amp;offset=50&amp;limit=100

To fetch issues for a date range:
GET /issues.xml?created_on=><2012-03-01|2012-03-07


<?xml version="1.0" encoding="UTF-8"?>
<issues type="array" count="1640">
<project name="Redmine" id="1"/>
<tracker name="Feature" id="2"/>
<status name="New" id="1"/>
<priority name="Normal" id="4"/>
<author name="John Smith" id="10106"/>
<category name="Email notifications" id="9"/>
Aggregate Multiple Issue Changes for Email Notifications
This is not to be confused with another useful proposed feature that
would do digest emails for notifications.
<custom_field name="Resolution" id="2">Duplicate</custom_field>
<custom_field name="Texte" id="5">Test</custom_field>
<custom_field name="Boolean" id="6">1</custom_field>
<custom_field name="Date" id="7">2010-01-12</custom_field>
<created_on>Thu Dec 03 15:02:12 +0100 2009</created_on>
<updated_on>Sun Jan 03 12:08:41 +0100 2010</updated_on>

h2. Showing an issue

GET /issues/[id].[format]


* @include@: fetch associated data (optional, use comma to fetch multiple associations). Possible values:

* @children@
* @attachments@
* @relations@
* @changesets@
* @journals@ - See [[Rest_IssueJournals|Issue journals]] for more information.
* @watchers@ - Since 2.3.0


GET /issues/2.xml
GET /issues/2.json

GET /issues/2.xml
GET /issues/2.xml?include=attachments
GET /issues/2.xml?include=attachments,journals

h2. Creating an issue

POST /issues.[format]

+Parameters+: h3. Using XML

* @issue@ - A hash of the issue attributes:

* @project_id@
* @tracker_id@ POST /issues.xml
* @status_id@ &lt;?xml version=&quot;1.0&quot;?&gt;
* @subject@ &lt;issue&gt;


Other available tags:
* @description@
* @category_id@
* @assigned_to_id@ assigned_to_id - ID of the user to assign the issue to (currently no mechanism to assign by name)

* @parent_issue_id@ status_id
* parent_issue_id
- ID of the parent issue

* @custom_fields@ watcher_user_ids - See [[Rest_api#Working-with-custom-fields|Custom fields]]
* @watcher_user_ids@ -
Array of user ids to add as watchers (since 2.3.0)

Attachments can be added when you create an issue, see [[Rest_api#Attaching-files|Attaching files]].


h3. Using JSON

POST /issues.xml
<?xml version="1.0"?>

POST /issues.json

"issue": {

"project_id": 1,
"subject": "Example", &quot;Test issue&quot;,
&quot;1&quot;:&quot;1.1.3&quot; #the affected version field

"priority_id": 4

h2. Updating an issue

PUT /issues/[id].[format]


* @issue@ - A hash of the issue attributes

* @project_id@
* @tracker_id@
* @status_id@
* @subject@
* ...
* @notes@ - Comments about the update

Attachments can be added when you update an issue, see [[Rest_api#Attaching-files|Attaching files]].


h3. Using XML

PUT /issues/[id].xml
<?xml version="1.0"?>
<subject>Subject changed</subject>
<notes>The subject was changed</notes>

h3. Using JSON

PUT /issues/[id].json


"issue": {

"subject": "Subject changed", &quot;Example issue (was: Test issue)&quot;,
&quot;notes&quot;: &quot;Changing the subject&quot;

"notes": "The subject was changed"

h2. Deleting an issue

DELETE /issues/[id].[format] /issues/[id].xml

h2. Adding a watcher

POST /issues/[id]/watchers.[format]


* @user_id@ (required): id of the user to add as a watcher

h2. Removing a watcher

DELETE /issues/[id]/watchers/[user_id].[format]

+Parameters+: _none_