56 KiB
openapi.api.WorkPackagesApi
Load the API package
import 'package:openapi/api.dart';
All URIs are relative to https://community.openproject.org
| Method | HTTP request | Description |
|---|---|---|
| addWatcher | POST /api/v3/work_packages/{id}/watchers | Add watcher |
| availableAssignees | GET /api/v3/projects/{id}/available_assignees | Available assignees |
| availableProjectsForWorkPackage | GET /api/v3/work_packages/{id}/available_projects | Available projects for work package |
| availableResponsibles | GET /api/v3/projects/{id}/available_responsibles | Available responsibles |
| availableWatchers | GET /api/v3/work_packages/{id}/available_watchers | Available watchers |
| commentWorkPackage | POST /api/v3/work_packages/{id}/activities | Comment work package |
| createProjectWorkPackage | POST /api/v3/projects/{id}/work_packages | Create work package in project |
| createRelation | POST /api/v3/work_packages/{id}/relations | Create Relation |
| createWorkPackage | POST /api/v3/work_packages | Create Work Package |
| createWorkPackageFileLink | POST /api/v3/work_packages/{id}/file_links | Creates file links. |
| deleteWorkPackage | DELETE /api/v3/work_packages/{id} | Delete Work Package |
| getProjectWorkPackageCollection | GET /api/v3/projects/{id}/work_packages | Get work packages of project |
| listAvailableRelationCandidates | GET /api/v3/work_packages/{id}/available_relation_candidates | Available relation candidates |
| listRelations | GET /api/v3/work_packages/{id}/relations | List relations |
| listWatchers | GET /api/v3/work_packages/{id}/watchers | List watchers |
| listWorkPackageActivities | GET /api/v3/work_packages/{id}/activities | List work package activities |
| listWorkPackageFileLinks | GET /api/v3/work_packages/{id}/file_links | Gets all file links of a work package |
| listWorkPackageSchemas | GET /api/v3/work_packages/schemas | List Work Package Schemas |
| listWorkPackages | GET /api/v3/work_packages | List work packages |
| removeWatcher | DELETE /api/v3/work_packages/{id}/watchers/{user_id} | Remove watcher |
| revisions | GET /api/v3/work_packages/{id}/revisions | Revisions |
| updateWorkPackage | PATCH /api/v3/work_packages/{id} | Update a Work Package |
| viewWorkPackage | GET /api/v3/work_packages/{id} | View Work Package |
| viewWorkPackageSchema | GET /api/v3/work_packages/schemas/{identifier} | View Work Package Schema |
| workPackageCreateForm | POST /api/v3/work_packages/form | Work Package Create Form |
| workPackageCreateFormForProject | POST /api/v3/projects/{id}/work_packages/form | Work Package Create Form For Project |
| workPackageEditForm | POST /api/v3/work_packages/{id}/form | Work Package Edit Form |
addWatcher
addWatcher(id, addWatcherRequest)
Add watcher
Adds a watcher to the specified work package. The request is expected to contain a single JSON object, that contains a link object under the user key. The response will be user added as watcher. In case the user was already watching the work package an HTTP 200 is returned, an HTTP 201 if the user was added as a new watcher.
Example
import 'package:openapi/api.dart';
// TODO Configure HTTP basic authorization: BasicAuth
//defaultApiClient.getAuthentication<HttpBasicAuth>('BasicAuth').username = 'YOUR_USERNAME'
//defaultApiClient.getAuthentication<HttpBasicAuth>('BasicAuth').password = 'YOUR_PASSWORD';
final api_instance = WorkPackagesApi();
final id = 1; // int | Work package id
final addWatcherRequest = AddWatcherRequest(); // AddWatcherRequest |
try {
api_instance.addWatcher(id, addWatcherRequest);
} catch (e) {
print('Exception when calling WorkPackagesApi->addWatcher: $e\n');
}
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| id | int | Work package id | |
| addWatcherRequest | AddWatcherRequest | [optional] |
Return type
void (empty response body)
Authorization
HTTP request headers
- Content-Type: application/json
- Accept: application/hal+json, text/plain
[Back to top] [Back to API list] [Back to Model list] [Back to README]
availableAssignees
Object availableAssignees(id)
Available assignees
Gets a list of users that can be assigned to work packages in the given project.
Example
import 'package:openapi/api.dart';
// TODO Configure HTTP basic authorization: BasicAuth
//defaultApiClient.getAuthentication<HttpBasicAuth>('BasicAuth').username = 'YOUR_USERNAME'
//defaultApiClient.getAuthentication<HttpBasicAuth>('BasicAuth').password = 'YOUR_PASSWORD';
final api_instance = WorkPackagesApi();
final id = 1; // int | Project id
try {
final result = api_instance.availableAssignees(id);
print(result);
} catch (e) {
print('Exception when calling WorkPackagesApi->availableAssignees: $e\n');
}
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| id | int | Project id |
Return type
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: application/hal+json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
availableProjectsForWorkPackage
Object availableProjectsForWorkPackage(id)
Available projects for work package
Gets a list of projects that are available as projects to which the work package can be moved.
Example
import 'package:openapi/api.dart';
// TODO Configure HTTP basic authorization: BasicAuth
//defaultApiClient.getAuthentication<HttpBasicAuth>('BasicAuth').username = 'YOUR_USERNAME'
//defaultApiClient.getAuthentication<HttpBasicAuth>('BasicAuth').password = 'YOUR_PASSWORD';
final api_instance = WorkPackagesApi();
final id = 1; // int | work package id
try {
final result = api_instance.availableProjectsForWorkPackage(id);
print(result);
} catch (e) {
print('Exception when calling WorkPackagesApi->availableProjectsForWorkPackage: $e\n');
}
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| id | int | work package id |
Return type
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: application/hal+json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
availableResponsibles
Object availableResponsibles(id)
Available responsibles
Gets a list of users that can be assigned as the responsible of a work package in the given project.
Example
import 'package:openapi/api.dart';
// TODO Configure HTTP basic authorization: BasicAuth
//defaultApiClient.getAuthentication<HttpBasicAuth>('BasicAuth').username = 'YOUR_USERNAME'
//defaultApiClient.getAuthentication<HttpBasicAuth>('BasicAuth').password = 'YOUR_PASSWORD';
final api_instance = WorkPackagesApi();
final id = 1; // int | Project id
try {
final result = api_instance.availableResponsibles(id);
print(result);
} catch (e) {
print('Exception when calling WorkPackagesApi->availableResponsibles: $e\n');
}
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| id | int | Project id |
Return type
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: application/hal+json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
availableWatchers
Object availableWatchers(id)
Available watchers
Gets a list of users that are able to be watchers of the specified work package.
Example
import 'package:openapi/api.dart';
// TODO Configure HTTP basic authorization: BasicAuth
//defaultApiClient.getAuthentication<HttpBasicAuth>('BasicAuth').username = 'YOUR_USERNAME'
//defaultApiClient.getAuthentication<HttpBasicAuth>('BasicAuth').password = 'YOUR_PASSWORD';
final api_instance = WorkPackagesApi();
final id = 1; // int | work package id
try {
final result = api_instance.availableWatchers(id);
print(result);
} catch (e) {
print('Exception when calling WorkPackagesApi->availableWatchers: $e\n');
}
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| id | int | work package id |
Return type
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: application/hal+json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
commentWorkPackage
commentWorkPackage(id, notify, commentWorkPackageRequest)
Comment work package
Creates an activity for the selected work package and, on success, returns the updated activity.
Example
import 'package:openapi/api.dart';
// TODO Configure HTTP basic authorization: BasicAuth
//defaultApiClient.getAuthentication<HttpBasicAuth>('BasicAuth').username = 'YOUR_USERNAME'
//defaultApiClient.getAuthentication<HttpBasicAuth>('BasicAuth').password = 'YOUR_PASSWORD';
final api_instance = WorkPackagesApi();
final id = 1; // int | Work package id
final notify = false; // bool | Indicates whether change notifications (e.g. via E-Mail) should be sent. Note that this controls notifications for all users interested in changes to the work package (e.g. watchers, author and assignee), not just the current user.
final commentWorkPackageRequest = CommentWorkPackageRequest(); // CommentWorkPackageRequest |
try {
api_instance.commentWorkPackage(id, notify, commentWorkPackageRequest);
} catch (e) {
print('Exception when calling WorkPackagesApi->commentWorkPackage: $e\n');
}
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| id | int | Work package id | |
| notify | bool | Indicates whether change notifications (e.g. via E-Mail) should be sent. Note that this controls notifications for all users interested in changes to the work package (e.g. watchers, author and assignee), not just the current user. | [optional] [default to true] |
| commentWorkPackageRequest | CommentWorkPackageRequest | [optional] |
Return type
void (empty response body)
Authorization
HTTP request headers
- Content-Type: application/json
- Accept: application/hal+json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
createProjectWorkPackage
WorkPackageModel createProjectWorkPackage(id, notify)
Create work package in project
When calling this endpoint the client provides a single object, containing at least the properties and links that are required, in the body. The required fields of a WorkPackage can be found in its schema, which is embedded in the respective form. Note that it is only allowed to provide properties or links supporting the write operation.
Example
import 'package:openapi/api.dart';
// TODO Configure HTTP basic authorization: BasicAuth
//defaultApiClient.getAuthentication<HttpBasicAuth>('BasicAuth').username = 'YOUR_USERNAME'
//defaultApiClient.getAuthentication<HttpBasicAuth>('BasicAuth').password = 'YOUR_PASSWORD';
final api_instance = WorkPackagesApi();
final id = 1; // int | Project id
final notify = false; // bool | Indicates whether change notifications (e.g. via E-Mail) should be sent. Note that this controls notifications for all users interested in changes to the work package (e.g. watchers, author and assignee), not just the current user.
try {
final result = api_instance.createProjectWorkPackage(id, notify);
print(result);
} catch (e) {
print('Exception when calling WorkPackagesApi->createProjectWorkPackage: $e\n');
}
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| id | int | Project id | |
| notify | bool | Indicates whether change notifications (e.g. via E-Mail) should be sent. Note that this controls notifications for all users interested in changes to the work package (e.g. watchers, author and assignee), not just the current user. | [optional] [default to true] |
Return type
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: application/hal+json, text/plain
[Back to top] [Back to API list] [Back to Model list] [Back to README]
createRelation
createRelation(id)
Create Relation
When calling this endpoint the client provides a single object, containing at least the properties and links that are required, in the body. The required fields of a Relation can be found in its schema, which is embedded in the respective form. Note that it is only allowed to provide properties or links supporting the write operation.
Example
import 'package:openapi/api.dart';
// TODO Configure HTTP basic authorization: BasicAuth
//defaultApiClient.getAuthentication<HttpBasicAuth>('BasicAuth').username = 'YOUR_USERNAME'
//defaultApiClient.getAuthentication<HttpBasicAuth>('BasicAuth').password = 'YOUR_PASSWORD';
final api_instance = WorkPackagesApi();
final id = 1; // int | Work package id
try {
api_instance.createRelation(id);
} catch (e) {
print('Exception when calling WorkPackagesApi->createRelation: $e\n');
}
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| id | int | Work package id |
Return type
void (empty response body)
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: application/hal+json, text/plain
[Back to top] [Back to API list] [Back to Model list] [Back to README]
createWorkPackage
WorkPackageModel createWorkPackage(notify, workPackageModel)
Create Work Package
When calling this endpoint the client provides a single object, containing at least the properties and links that are required, in the body. The required fields of a WorkPackage can be found in its schema, which is embedded in the respective form. Note that it is only allowed to provide properties or links supporting the write operation. A project link must be set when creating work packages through this route. When setting start date, finish date, and duration together, their correctness will be checked and a 422 error will be returned if one value does not match with the two others. You can make the server compute a value: set only two values in the request and the third one will be computed and returned in the response. For instance, when sending { \"startDate\": \"2022-08-23\", duration: \"P2D\" }, the response will include { \"dueDate\": \"2022-08-24\" }.
Example
import 'package:openapi/api.dart';
// TODO Configure HTTP basic authorization: BasicAuth
//defaultApiClient.getAuthentication<HttpBasicAuth>('BasicAuth').username = 'YOUR_USERNAME'
//defaultApiClient.getAuthentication<HttpBasicAuth>('BasicAuth').password = 'YOUR_PASSWORD';
final api_instance = WorkPackagesApi();
final notify = false; // bool | Indicates whether change notifications (e.g. via E-Mail) should be sent. Note that this controls notifications for all users interested in changes to the work package (e.g. watchers, author and assignee), not just the current user.
final workPackageModel = WorkPackageModel(); // WorkPackageModel |
try {
final result = api_instance.createWorkPackage(notify, workPackageModel);
print(result);
} catch (e) {
print('Exception when calling WorkPackagesApi->createWorkPackage: $e\n');
}
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| notify | bool | Indicates whether change notifications (e.g. via E-Mail) should be sent. Note that this controls notifications for all users interested in changes to the work package (e.g. watchers, author and assignee), not just the current user. | [optional] [default to true] |
| workPackageModel | WorkPackageModel | [optional] |
Return type
Authorization
HTTP request headers
- Content-Type: application/json
- Accept: application/hal+json, text/plain
[Back to top] [Back to API list] [Back to Model list] [Back to README]
createWorkPackageFileLink
FileLinkCollectionReadModel createWorkPackageFileLink(id, fileLinkCollectionWriteModel)
Creates file links.
Creates file links on a work package. The request is interpreted as a bulk insert, where every element of the collection is validated separately. Each element contains the origin meta data and a link to the storage, the file link is about to point to. The storage link can be provided as a resource link with id or as the host url. The file's id and name are considered mandatory information. The rest of the origin meta data SHOULD be provided by the client. The mimeType SHOULD be a standard mime type. An empty mime type will be handled as unknown. To link a folder, the custom mime type application/x-op-directory MUST be used. Up to 20 file links can be submitted at once. If any element data is invalid, no file links will be created. If a file link with matching origin id, work package, and storage already exists, then it will not create an additional file link or update the meta data. Instead the information from the existing file link will be returned.
Example
import 'package:openapi/api.dart';
// TODO Configure HTTP basic authorization: BasicAuth
//defaultApiClient.getAuthentication<HttpBasicAuth>('BasicAuth').username = 'YOUR_USERNAME'
//defaultApiClient.getAuthentication<HttpBasicAuth>('BasicAuth').password = 'YOUR_PASSWORD';
final api_instance = WorkPackagesApi();
final id = 1337; // int | Work package id
final fileLinkCollectionWriteModel = FileLinkCollectionWriteModel(); // FileLinkCollectionWriteModel |
try {
final result = api_instance.createWorkPackageFileLink(id, fileLinkCollectionWriteModel);
print(result);
} catch (e) {
print('Exception when calling WorkPackagesApi->createWorkPackageFileLink: $e\n');
}
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| id | int | Work package id | |
| fileLinkCollectionWriteModel | FileLinkCollectionWriteModel | [optional] |
Return type
Authorization
HTTP request headers
- Content-Type: application/json
- Accept: application/hal+json, text/plain
[Back to top] [Back to API list] [Back to Model list] [Back to README]
deleteWorkPackage
deleteWorkPackage(id)
Delete Work Package
Deletes the work package, as well as: - all associated time entries - its hierarchy of child work packages
Example
import 'package:openapi/api.dart';
// TODO Configure HTTP basic authorization: BasicAuth
//defaultApiClient.getAuthentication<HttpBasicAuth>('BasicAuth').username = 'YOUR_USERNAME'
//defaultApiClient.getAuthentication<HttpBasicAuth>('BasicAuth').password = 'YOUR_PASSWORD';
final api_instance = WorkPackagesApi();
final id = 1; // int | Work package id
try {
api_instance.deleteWorkPackage(id);
} catch (e) {
print('Exception when calling WorkPackagesApi->deleteWorkPackage: $e\n');
}
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| id | int | Work package id |
Return type
void (empty response body)
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: application/hal+json, text/plain
[Back to top] [Back to API list] [Back to Model list] [Back to README]
getProjectWorkPackageCollection
WorkPackagesModel getProjectWorkPackageCollection(id, offset, pageSize, filters, sortBy, groupBy, showSums, select)
Get work packages of project
Returns the collection of work packages that are related to the given project.
Example
import 'package:openapi/api.dart';
// TODO Configure HTTP basic authorization: BasicAuth
//defaultApiClient.getAuthentication<HttpBasicAuth>('BasicAuth').username = 'YOUR_USERNAME'
//defaultApiClient.getAuthentication<HttpBasicAuth>('BasicAuth').password = 'YOUR_PASSWORD';
final api_instance = WorkPackagesApi();
final id = 1; // int | Project id
final offset = 25; // int | Page number inside the requested collection.
final pageSize = 25; // int | Number of elements to display per page.
final filters = [{ "type_id": { "operator": "=", "values": ['1', '2'] }}]; // String | JSON specifying filter conditions. Accepts the same format as returned by the [queries](https://www.openproject.org/docs/api/endpoints/queries/) endpoint. If no filter is to be applied, the client should send an empty array (`[]`).
final sortBy = [["status", "asc"]]; // String | JSON specifying sort criteria. Accepts the same format as returned by the [queries](https://www.openproject.org/docs/api/endpoints/queries/) endpoint.
final groupBy = status; // String | The column to group by.
final showSums = true; // bool | Indicates whether properties should be summed up if they support it.
final select = total,elements/subject,elements/id,self; // String | Comma separated list of properties to include.
try {
final result = api_instance.getProjectWorkPackageCollection(id, offset, pageSize, filters, sortBy, groupBy, showSums, select);
print(result);
} catch (e) {
print('Exception when calling WorkPackagesApi->getProjectWorkPackageCollection: $e\n');
}
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| id | int | Project id | |
| offset | int | Page number inside the requested collection. | [optional] [default to 1] |
| pageSize | int | Number of elements to display per page. | [optional] |
| filters | String | JSON specifying filter conditions. Accepts the same format as returned by the queries endpoint. If no filter is to be applied, the client should send an empty array ([]). |
[optional] [default to '[{ "status_id": { "operator": "o", "values": null }}]'] |
| sortBy | String | JSON specifying sort criteria. Accepts the same format as returned by the queries endpoint. | [optional] [default to '"id", "asc"'] |
| groupBy | String | The column to group by. | [optional] |
| showSums | bool | Indicates whether properties should be summed up if they support it. | [optional] [default to false] |
| select | String | Comma separated list of properties to include. | [optional] |
Return type
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: application/hal+json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
listAvailableRelationCandidates
Object listAvailableRelationCandidates(id, pageSize, filters, query, type, sortBy)
Available relation candidates
Example
import 'package:openapi/api.dart';
// TODO Configure HTTP basic authorization: BasicAuth
//defaultApiClient.getAuthentication<HttpBasicAuth>('BasicAuth').username = 'YOUR_USERNAME'
//defaultApiClient.getAuthentication<HttpBasicAuth>('BasicAuth').password = 'YOUR_PASSWORD';
final api_instance = WorkPackagesApi();
final id = 1; // int | Project id
final pageSize = 25; // int | Maximum number of candidates to list (default 10)
final filters = [{ "status_id": { "operator": "o", "values": null } }]; // String | JSON specifying filter conditions. Accepts the same filters as the [work packages](https://www.openproject.org/docs/api/endpoints/work-packages/) endpoint.
final query = "rollout"; // String | Shortcut for filtering by ID or subject
final type = "follows"; // String | Type of relation to find candidates for (default \"relates\")
final sortBy = [["status", "asc"]]; // String | JSON specifying sort criteria. Accepts the same sort criteria as the [work packages](https://www.openproject.org/docs/api/endpoints/work-packages/) endpoint.
try {
final result = api_instance.listAvailableRelationCandidates(id, pageSize, filters, query, type, sortBy);
print(result);
} catch (e) {
print('Exception when calling WorkPackagesApi->listAvailableRelationCandidates: $e\n');
}
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| id | int | Project id | |
| pageSize | int | Maximum number of candidates to list (default 10) | [optional] |
| filters | String | JSON specifying filter conditions. Accepts the same filters as the work packages endpoint. | [optional] |
| query | String | Shortcut for filtering by ID or subject | [optional] |
| type | String | Type of relation to find candidates for (default "relates") | [optional] |
| sortBy | String | JSON specifying sort criteria. Accepts the same sort criteria as the work packages endpoint. | [optional] [default to '"id", "asc"'] |
Return type
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: application/hal+json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
listRelations
listRelations(id)
List relations
Lists all relations this work package is involved in.
Example
import 'package:openapi/api.dart';
// TODO Configure HTTP basic authorization: BasicAuth
//defaultApiClient.getAuthentication<HttpBasicAuth>('BasicAuth').username = 'YOUR_USERNAME'
//defaultApiClient.getAuthentication<HttpBasicAuth>('BasicAuth').password = 'YOUR_PASSWORD';
final api_instance = WorkPackagesApi();
final id = 1; // int | Work package id
try {
api_instance.listRelations(id);
} catch (e) {
print('Exception when calling WorkPackagesApi->listRelations: $e\n');
}
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| id | int | Work package id |
Return type
void (empty response body)
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: text/plain
[Back to top] [Back to API list] [Back to Model list] [Back to README]
listWatchers
WatchersModel listWatchers(id)
List watchers
Example
import 'package:openapi/api.dart';
// TODO Configure HTTP basic authorization: BasicAuth
//defaultApiClient.getAuthentication<HttpBasicAuth>('BasicAuth').username = 'YOUR_USERNAME'
//defaultApiClient.getAuthentication<HttpBasicAuth>('BasicAuth').password = 'YOUR_PASSWORD';
final api_instance = WorkPackagesApi();
final id = 1; // int | Work package id
try {
final result = api_instance.listWatchers(id);
print(result);
} catch (e) {
print('Exception when calling WorkPackagesApi->listWatchers: $e\n');
}
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| id | int | Work package id |
Return type
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: application/hal+json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
listWorkPackageActivities
Object listWorkPackageActivities(id)
List work package activities
Example
import 'package:openapi/api.dart';
// TODO Configure HTTP basic authorization: BasicAuth
//defaultApiClient.getAuthentication<HttpBasicAuth>('BasicAuth').username = 'YOUR_USERNAME'
//defaultApiClient.getAuthentication<HttpBasicAuth>('BasicAuth').password = 'YOUR_PASSWORD';
final api_instance = WorkPackagesApi();
final id = 1; // int | Work package id
try {
final result = api_instance.listWorkPackageActivities(id);
print(result);
} catch (e) {
print('Exception when calling WorkPackagesApi->listWorkPackageActivities: $e\n');
}
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| id | int | Work package id |
Return type
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: application/hal+json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
listWorkPackageFileLinks
FileLinkCollectionReadModel listWorkPackageFileLinks(id, filters)
Gets all file links of a work package
Gets all file links of a work package. As a side effect, for every file link a request is sent to the storage's origin to fetch live data and patch the file link's data before returning, as well as retrieving permissions of the user on this origin file.
Example
import 'package:openapi/api.dart';
// TODO Configure HTTP basic authorization: BasicAuth
//defaultApiClient.getAuthentication<HttpBasicAuth>('BasicAuth').username = 'YOUR_USERNAME'
//defaultApiClient.getAuthentication<HttpBasicAuth>('BasicAuth').password = 'YOUR_PASSWORD';
final api_instance = WorkPackagesApi();
final id = 1337; // int | Work package id
final filters = [{"storage":{"operator":"=","values":["42"]}}]; // String | JSON specifying filter conditions. Accepts the same format as returned by the [queries](https://www.openproject.org/docs/api/endpoints/queries/) endpoint. The following filters are supported: - storage
try {
final result = api_instance.listWorkPackageFileLinks(id, filters);
print(result);
} catch (e) {
print('Exception when calling WorkPackagesApi->listWorkPackageFileLinks: $e\n');
}
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| id | int | Work package id | |
| filters | String | JSON specifying filter conditions. Accepts the same format as returned by the queries endpoint. The following filters are supported: - storage | [optional] |
Return type
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: application/hal+json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
listWorkPackageSchemas
Object listWorkPackageSchemas(filters)
List Work Package Schemas
List work package schemas.
Example
import 'package:openapi/api.dart';
// TODO Configure HTTP basic authorization: BasicAuth
//defaultApiClient.getAuthentication<HttpBasicAuth>('BasicAuth').username = 'YOUR_USERNAME'
//defaultApiClient.getAuthentication<HttpBasicAuth>('BasicAuth').password = 'YOUR_PASSWORD';
final api_instance = WorkPackagesApi();
final filters = [{ "id": { "operator": "=", "values": ["12-1", "14-2"] } }]; // String | JSON specifying filter conditions. Accepts the same format as returned by the [queries](https://www.openproject.org/docs/api/endpoints/queries/) endpoint. Currently supported filters are: + id: The schema's id Schema id has the form `project_id-work_package_type_id`.
try {
final result = api_instance.listWorkPackageSchemas(filters);
print(result);
} catch (e) {
print('Exception when calling WorkPackagesApi->listWorkPackageSchemas: $e\n');
}
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| filters | String | JSON specifying filter conditions. Accepts the same format as returned by the queries endpoint. Currently supported filters are: + id: The schema's id Schema id has the form project_id-work_package_type_id. |
Return type
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: application/hal+json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
listWorkPackages
WorkPackagesModel listWorkPackages(offset, pageSize, filters, sortBy, groupBy, showSums, select, timestamps)
List work packages
Returns a collection of work packages.
Example
import 'package:openapi/api.dart';
// TODO Configure HTTP basic authorization: BasicAuth
//defaultApiClient.getAuthentication<HttpBasicAuth>('BasicAuth').username = 'YOUR_USERNAME'
//defaultApiClient.getAuthentication<HttpBasicAuth>('BasicAuth').password = 'YOUR_PASSWORD';
final api_instance = WorkPackagesApi();
final offset = 25; // int | Page number inside the requested collection.
final pageSize = 25; // int | Number of elements to display per page.
final filters = [{ "type_id": { "operator": "=", "values": ["1", "2"] }}]; // String | JSON specifying filter conditions. Accepts the same format as returned by the [queries](https://www.openproject.org/docs/api/endpoints/queries/) endpoint. If no filter is to be applied, the client should send an empty array (`[]`), otherwise a default filter is applied. A Currently supported filters are (there are additional filters added by modules): - assigned_to - assignee_or_group - attachment_base - attachment_content - attachment_file_name - author - blocked - blocks - category - comment - created_at - custom_field - dates_interval - description - done_ratio - due_date - duplicated - duplicates - duration - estimated_hours - file_link_origin_id - follows - group - id - includes - linkable_to_storage_id - linkable_to_storage_url - manual_sort - milestone - only_subproject - parent - partof - precedes - principal_base - priority - project - relatable - relates - required - requires - responsible - role - search - start_date - status - storage_id - storage_url - subject - subject_or_id - subproject - type - typeahead - updated_at - version - watcher - work_package
final sortBy = [["status", "asc"]]; // String | JSON specifying sort criteria. Accepts the same format as returned by the [queries](https://www.openproject.org/docs/api/endpoints/queries/) endpoint.
final groupBy = status; // String | The column to group by.
final showSums = true; // bool | Indicates whether properties should be summed up if they support it.
final select = total,elements/subject,elements/id,self; // String | Comma separated list of properties to include.
final timestamps = 2022-01-01T00:00:00Z,PT0S; // String | In order to perform a [baseline comparison](/docs/api/baseline-comparisons), you may provide one or several timestamps in ISO-8601 format as comma-separated list. The timestamps may be absolute or relative, such as ISO8601 dates, ISO8601 durations and the following relative date keywords: \"oneDayAgo@HH:MM+HH:MM\", \"lastWorkingDay@HH:MM+HH:MM\", \"oneWeekAgo@HH:MM+HH:MM\", \"oneMonthAgo@HH:MM+HH:MM\". The first \"HH:MM\" part represents the zero paded hours and minutes. The last \"+HH:MM\" part represents the timezone offset from UTC associated with the time, the offset can be positive or negative e.g.\"oneDayAgo@01:00+01:00\", \"oneDayAgo@01:00-01:00\". Usually, the first timestamp is the baseline date, the last timestamp is the current date. Values older than 1 day are accepted only with valid Enterprise Token available.
try {
final result = api_instance.listWorkPackages(offset, pageSize, filters, sortBy, groupBy, showSums, select, timestamps);
print(result);
} catch (e) {
print('Exception when calling WorkPackagesApi->listWorkPackages: $e\n');
}
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| offset | int | Page number inside the requested collection. | [optional] [default to 1] |
| pageSize | int | Number of elements to display per page. | [optional] |
| filters | String | JSON specifying filter conditions. Accepts the same format as returned by the queries endpoint. If no filter is to be applied, the client should send an empty array ([]), otherwise a default filter is applied. A Currently supported filters are (there are additional filters added by modules): - assigned_to - assignee_or_group - attachment_base - attachment_content - attachment_file_name - author - blocked - blocks - category - comment - created_at - custom_field - dates_interval - description - done_ratio - due_date - duplicated - duplicates - duration - estimated_hours - file_link_origin_id - follows - group - id - includes - linkable_to_storage_id - linkable_to_storage_url - manual_sort - milestone - only_subproject - parent - partof - precedes - principal_base - priority - project - relatable - relates - required - requires - responsible - role - search - start_date - status - storage_id - storage_url - subject - subject_or_id - subproject - type - typeahead - updated_at - version - watcher - work_package |
[optional] [default to '[{ "status_id": { "operator": "o", "values": null }}]'] |
| sortBy | String | JSON specifying sort criteria. Accepts the same format as returned by the queries endpoint. | [optional] [default to '"id", "asc"'] |
| groupBy | String | The column to group by. | [optional] |
| showSums | bool | Indicates whether properties should be summed up if they support it. | [optional] [default to false] |
| select | String | Comma separated list of properties to include. | [optional] |
| timestamps | String | In order to perform a baseline comparison, you may provide one or several timestamps in ISO-8601 format as comma-separated list. The timestamps may be absolute or relative, such as ISO8601 dates, ISO8601 durations and the following relative date keywords: "oneDayAgo@HH:MM+HH:MM", "lastWorkingDay@HH:MM+HH:MM", "oneWeekAgo@HH:MM+HH:MM", "oneMonthAgo@HH:MM+HH:MM". The first "HH:MM" part represents the zero paded hours and minutes. The last "+HH:MM" part represents the timezone offset from UTC associated with the time, the offset can be positive or negative e.g."oneDayAgo@01:00+01:00", "oneDayAgo@01:00-01:00". Usually, the first timestamp is the baseline date, the last timestamp is the current date. Values older than 1 day are accepted only with valid Enterprise Token available. | [optional] [default to 'PT0S'] |
Return type
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: application/hal+json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
removeWatcher
removeWatcher(id, userId)
Remove watcher
Removes the specified user from the list of watchers for the given work package. If the request succeeds, the specified user is not watching the work package anymore. Note: This might also be the case, if the specified user did not watch the work package prior to the request.
Example
import 'package:openapi/api.dart';
// TODO Configure HTTP basic authorization: BasicAuth
//defaultApiClient.getAuthentication<HttpBasicAuth>('BasicAuth').username = 'YOUR_USERNAME'
//defaultApiClient.getAuthentication<HttpBasicAuth>('BasicAuth').password = 'YOUR_PASSWORD';
final api_instance = WorkPackagesApi();
final id = 1; // int | Work package id
final userId = 1; // int | User id
try {
api_instance.removeWatcher(id, userId);
} catch (e) {
print('Exception when calling WorkPackagesApi->removeWatcher: $e\n');
}
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| id | int | Work package id | |
| userId | int | User id |
Return type
void (empty response body)
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: application/hal+json, text/plain
[Back to top] [Back to API list] [Back to Model list] [Back to README]
revisions
Object revisions(id)
Revisions
Gets a list of revisions that are linked to this work package, e.g., because it is referenced in the commit message of the revision. Only linked revisions from repositories are shown if the user has the view changesets permission in the defining project.
Example
import 'package:openapi/api.dart';
// TODO Configure HTTP basic authorization: BasicAuth
//defaultApiClient.getAuthentication<HttpBasicAuth>('BasicAuth').username = 'YOUR_USERNAME'
//defaultApiClient.getAuthentication<HttpBasicAuth>('BasicAuth').password = 'YOUR_PASSWORD';
final api_instance = WorkPackagesApi();
final id = 1; // int | Work package id
try {
final result = api_instance.revisions(id);
print(result);
} catch (e) {
print('Exception when calling WorkPackagesApi->revisions: $e\n');
}
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| id | int | Work package id |
Return type
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: application/hal+json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
updateWorkPackage
WorkPackagePatchModel updateWorkPackage(id, notify, workPackageModel)
Update a Work Package
When calling this endpoint the client provides a single object, containing the properties and links that it wants to change, in the body. Note that it is only allowed to provide properties or links supporting the write operation. Additionally to the fields the client wants to change, it is mandatory to provide the value of lockVersion which was received by the GET request this change originates from. The value of lockVersion is used to implement optimistic locking.
Example
import 'package:openapi/api.dart';
// TODO Configure HTTP basic authorization: BasicAuth
//defaultApiClient.getAuthentication<HttpBasicAuth>('BasicAuth').username = 'YOUR_USERNAME'
//defaultApiClient.getAuthentication<HttpBasicAuth>('BasicAuth').password = 'YOUR_PASSWORD';
final api_instance = WorkPackagesApi();
final id = 42; // int | Work package id
final notify = false; // bool | Indicates whether change notifications should be sent. Note that this controls notifications for all users interested in changes to the work package (e.g. watchers, author and assignee), not just the current user.
final workPackageModel = WorkPackageModel(); // WorkPackageModel |
try {
final result = api_instance.updateWorkPackage(id, notify, workPackageModel);
print(result);
} catch (e) {
print('Exception when calling WorkPackagesApi->updateWorkPackage: $e\n');
}
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| id | int | Work package id | |
| notify | bool | Indicates whether change notifications should be sent. Note that this controls notifications for all users interested in changes to the work package (e.g. watchers, author and assignee), not just the current user. | [optional] [default to true] |
| workPackageModel | WorkPackageModel | [optional] |
Return type
Authorization
HTTP request headers
- Content-Type: application/json
- Accept: application/hal+json, text/plain
[Back to top] [Back to API list] [Back to Model list] [Back to README]
viewWorkPackage
WorkPackageModel viewWorkPackage(id, timestamps)
View Work Package
Returns the specified work package.
Example
import 'package:openapi/api.dart';
// TODO Configure HTTP basic authorization: BasicAuth
//defaultApiClient.getAuthentication<HttpBasicAuth>('BasicAuth').username = 'YOUR_USERNAME'
//defaultApiClient.getAuthentication<HttpBasicAuth>('BasicAuth').password = 'YOUR_PASSWORD';
final api_instance = WorkPackagesApi();
final id = 1; // int | Work package id
final timestamps = 2022-01-01T00:00:00Z,PT0S; // String | In order to perform a [baseline comparison](/docs/api/baseline-comparisons) of the work-package attributes, you may provide one or several timestamps in ISO-8601 format as comma-separated list. The timestamps may be absolute or relative, such as ISO8601 dates, ISO8601 durations and the following relative date keywords: \"oneDayAgo@HH:MM+HH:MM\", \"lastWorkingDay@HH:MM+HH:MM\", \"oneWeekAgo@HH:MM+HH:MM\", \"oneMonthAgo@HH:MM+HH:MM\". The first \"HH:MM\" part represents the zero paded hours and minutes. The last \"+HH:MM\" part represents the timezone offset from UTC associated with the time, the offset can be positive or negative e.g.\"oneDayAgo@01:00+01:00\", \"oneDayAgo@01:00-01:00\". Usually, the first timestamp is the baseline date, the last timestamp is the current date. Values older than 1 day are accepted only with valid Enterprise Token available.
try {
final result = api_instance.viewWorkPackage(id, timestamps);
print(result);
} catch (e) {
print('Exception when calling WorkPackagesApi->viewWorkPackage: $e\n');
}
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| id | int | Work package id | |
| timestamps | String | In order to perform a baseline comparison of the work-package attributes, you may provide one or several timestamps in ISO-8601 format as comma-separated list. The timestamps may be absolute or relative, such as ISO8601 dates, ISO8601 durations and the following relative date keywords: "oneDayAgo@HH:MM+HH:MM", "lastWorkingDay@HH:MM+HH:MM", "oneWeekAgo@HH:MM+HH:MM", "oneMonthAgo@HH:MM+HH:MM". The first "HH:MM" part represents the zero paded hours and minutes. The last "+HH:MM" part represents the timezone offset from UTC associated with the time, the offset can be positive or negative e.g."oneDayAgo@01:00+01:00", "oneDayAgo@01:00-01:00". Usually, the first timestamp is the baseline date, the last timestamp is the current date. Values older than 1 day are accepted only with valid Enterprise Token available. | [optional] [default to 'PT0S'] |
Return type
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: application/hal+json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
viewWorkPackageSchema
viewWorkPackageSchema(identifier)
View Work Package Schema
Example
import 'package:openapi/api.dart';
// TODO Configure HTTP basic authorization: BasicAuth
//defaultApiClient.getAuthentication<HttpBasicAuth>('BasicAuth').username = 'YOUR_USERNAME'
//defaultApiClient.getAuthentication<HttpBasicAuth>('BasicAuth').password = 'YOUR_PASSWORD';
final api_instance = WorkPackagesApi();
final identifier = 12-13; // String | Identifier of the schema
try {
api_instance.viewWorkPackageSchema(identifier);
} catch (e) {
print('Exception when calling WorkPackagesApi->viewWorkPackageSchema: $e\n');
}
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| identifier | String | Identifier of the schema |
Return type
void (empty response body)
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: application/hal+json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
workPackageCreateForm
workPackageCreateForm()
Work Package Create Form
Example
import 'package:openapi/api.dart';
// TODO Configure HTTP basic authorization: BasicAuth
//defaultApiClient.getAuthentication<HttpBasicAuth>('BasicAuth').username = 'YOUR_USERNAME'
//defaultApiClient.getAuthentication<HttpBasicAuth>('BasicAuth').password = 'YOUR_PASSWORD';
final api_instance = WorkPackagesApi();
try {
api_instance.workPackageCreateForm();
} catch (e) {
print('Exception when calling WorkPackagesApi->workPackageCreateForm: $e\n');
}
Parameters
This endpoint does not need any parameter.
Return type
void (empty response body)
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: Not defined
[Back to top] [Back to API list] [Back to Model list] [Back to README]
workPackageCreateFormForProject
workPackageCreateFormForProject(id)
Work Package Create Form For Project
Example
import 'package:openapi/api.dart';
// TODO Configure HTTP basic authorization: BasicAuth
//defaultApiClient.getAuthentication<HttpBasicAuth>('BasicAuth').username = 'YOUR_USERNAME'
//defaultApiClient.getAuthentication<HttpBasicAuth>('BasicAuth').password = 'YOUR_PASSWORD';
final api_instance = WorkPackagesApi();
final id = 1; // int | ID of the project in which the work package will be created
try {
api_instance.workPackageCreateFormForProject(id);
} catch (e) {
print('Exception when calling WorkPackagesApi->workPackageCreateFormForProject: $e\n');
}
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| id | int | ID of the project in which the work package will be created |
Return type
void (empty response body)
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: Not defined
[Back to top] [Back to API list] [Back to Model list] [Back to README]
workPackageEditForm
workPackageEditForm(id, workPackageModel)
Work Package Edit Form
When calling this endpoint, the client provides a single object containing the properties and links to be edited, in the body. Note that it is only allowed to provide properties or links supporting the write operation. When setting start date, finish date, and duration together, their correctness will be checked and a 422 error will be returned if one value does not match with the two others. You can make the server compute a value: set only two values in the request and the third one will be computed and returned in the response. For instance, when sending { \"startDate\": \"2022-08-23\", duration: \"P2D\" }, the response will include { \"dueDate\": \"2022-08-24\" }.
Example
import 'package:openapi/api.dart';
// TODO Configure HTTP basic authorization: BasicAuth
//defaultApiClient.getAuthentication<HttpBasicAuth>('BasicAuth').username = 'YOUR_USERNAME'
//defaultApiClient.getAuthentication<HttpBasicAuth>('BasicAuth').password = 'YOUR_PASSWORD';
final api_instance = WorkPackagesApi();
final id = 1; // int | ID of the work package being modified
final workPackageModel = WorkPackageModel(); // WorkPackageModel |
try {
api_instance.workPackageEditForm(id, workPackageModel);
} catch (e) {
print('Exception when calling WorkPackagesApi->workPackageEditForm: $e\n');
}
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| id | int | ID of the work package being modified | |
| workPackageModel | WorkPackageModel | [optional] |
Return type
void (empty response body)
Authorization
HTTP request headers
- Content-Type: application/json
- Accept: application/hal+json, text/plain
[Back to top] [Back to API list] [Back to Model list] [Back to README]