Content
Updated by Martin Czuchra almost 11 years ago
**As** Developer
**I want** to be able to read workflows via the REST-API,
**so that** my external application can decide if a certain status-transition is allowed or prohibited.
**Acceptance criteria**
- The API v2 provides read access to workflows
- Ability to determine allowed transitions for current (authenticated) user
**Of our scope**
- write-access (i.e. change allowed transitions for a role/user)
- ability to determine allowed transitions for any other user
## Implementation Details
### Endpoint
api/v2/projects/1/workflows.xml
### Response
<?xml version="1.0" encoding="UTF-8"?>
<workflows>
<workflow>
<type_id>$(integer)</type_id>
<old_status_id>$(integer)</old_status_id>
<transitions>
<transition>
<new_status_id>$(integer)</new_status_id>
<scope>$(role|author|assignee)</scope>
</transition>
<transition>
<new_status_id>$(integer)</new_status_id>
<scope>$(role|author|assignee)</scope>
</transition>
<transition>
<new_status_id>$(integer)</new_status_id>
<scope>$(role|author|assignee)</scope>
</transition>
</transitions>
</workflow>
</workflows>
The scopes are related to the following <code>author</code>/<code>assignee</code>:
<table>
<tbody>
<tr class="odd">
<td><strong>author</strong></td>
<td><strong>assignee</strong></td>
<td></td>
<td><strong>scope</strong></td>
</tr>
<tr class="even">
<td>false</td>
<td>false</td>
<td></td>
<td>role</td>
</tr>
<tr class="odd">
<td>false</td>
<td>true</td>
<td></td>
<td>assignee</td>
</tr>
<tr class="even">
<td>true</td>
<td>false</td>
<td></td>
<td>author</td>
</tr>
<tr class="odd">
<td>true</td>
<td>true</td>
<td></td>
<td><em>invalid</em></td>
</tr>
</tbody>
</table>
**I want** to be able to read workflows via the REST-API,
**so that** my external application can decide if a certain status-transition is allowed or prohibited.
**Acceptance criteria**
- The API v2 provides read access to workflows
- Ability to determine allowed transitions for current (authenticated) user
**Of our scope**
- write-access (i.e. change allowed transitions for a role/user)
- ability to determine allowed transitions for any other user
## Implementation Details
### Endpoint
api/v2/projects/1/workflows.xml
### Response
<?xml version="1.0" encoding="UTF-8"?>
<workflows>
<workflow>
<type_id>$(integer)</type_id>
<old_status_id>$(integer)</old_status_id>
<transitions>
<transition>
<new_status_id>$(integer)</new_status_id>
<scope>$(role|author|assignee)</scope>
</transition>
<transition>
<new_status_id>$(integer)</new_status_id>
<scope>$(role|author|assignee)</scope>
</transition>
<transition>
<new_status_id>$(integer)</new_status_id>
<scope>$(role|author|assignee)</scope>
</transition>
</transitions>
</workflow>
</workflows>
The scopes are related to the following <code>author</code>/<code>assignee</code>:
<table>
<tbody>
<tr class="odd">
<td><strong>author</strong></td>
<td><strong>assignee</strong></td>
<td></td>
<td><strong>scope</strong></td>
</tr>
<tr class="even">
<td>false</td>
<td>false</td>
<td></td>
<td>role</td>
</tr>
<tr class="odd">
<td>false</td>
<td>true</td>
<td></td>
<td>assignee</td>
</tr>
<tr class="even">
<td>true</td>
<td>false</td>
<td></td>
<td>author</td>
</tr>
<tr class="odd">
<td>true</td>
<td>true</td>
<td></td>
<td><em>invalid</em></td>
</tr>
</tbody>
</table>