Projects
This root resource lets you manage projects and their settings.
Resource |
api/admin/projects |
Returned entity | Project. For the description of the entity attributes, see Supported Fields section. |
Supported methods | |
Sub-resources |
|
Supported Fields
Field | Type | Description |
---|---|---|
archived | Boolean | When |
createdBy | User | Stores information about the user that created the project. |
description | String? | Project description. |
fields | ProjectCustomField | Stores a mutable collection of custom fields attached to the project. |
fromEmail | String | Stores an email set as the "From" address in notifications about project issues. |
hubResourceId | String! | |
iconUrl | String! | A URL to a project icon. |
issues | Issue | Collection of issues in the project. |
leader | User | Stores information about the user that is set as the project leader. |
query | String? | |
shortName | String? | Stores the project ID that is used as prefix in the issue IDs. |
startingNumber | Long | Stores the number that is assigned to the first issue in the project. |
timeTrackingEnabled | Boolean | Stores the current state of time tracking in the project. When |
usages | collections.Iterable | |
id | String | Unique project identifier. |
name | String? | Project name. |
Read the Projects List
Get a list of available projects.
Request syntax
GET /api/admin/projects[?{fields}&{$skip}&{$top}]
Request parameters
Parameter | Type | Description |
---|---|---|
fields | string | A list of project attributes that should be returned in the response. If no fields specified, only entityID is returned. |
$skip | int | Optional. Lets you set a number of returned entities to skip before returning the first one. |
$top | int | Optional. Lets you specify the maximum number of entries that are returned in the response. |
curl -X GET \
'https://example.myjetbrains.com/youtrack/api/admin/projects?fields=id,name,shortName,createdBy%28login,name,id%29,leader%28login,name,id%29' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer perm:am9obi5kb2U=.UG9zdG1hbiBKb2huIERvZQ==.jJe0eYhhkV271j1lCpfknNYOEakNk7' \
-H 'Cache-Control: no-cache' \
-H 'Content-Type: application/json'
[
{
"description": "A sample project based on the default project template",
"shortName": "SP",
"leader": {
"login": "root"
},
"createdBy": {
"login": "root"
},
"name": "Sample Project",
"id": "0-0"
}
]
Create a New Project
Create a new project.
Request syntax:
POST /api/admin/projects[?{fields}]
Request parameters:
Parameter | Description |
---|---|
fields | Optional list of fields to return in the response. |
To create a new project, send a POST request with the mandatory parameters shortName
, name
, and leader
in the request body.
Sample request:
curl -X POST \
'https://example.myjetbrains.com/youtrack/api/admin/projects?fields=id,shortName,name,leader%28id,login,name%29' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer perm:am9obi5kb2U=.UG9zdG1hbiBKb2huIERvZQ==.jJe0eYhhkV271j1lCpfknNYOEakNk7' \
-H 'Cache-Control: no-cache' \
-H 'Content-Type: application/json' \
-d '{
"description": "A new project created from rest api",
"name": "GRA Project",
"shortName": "GRP",
"leader":{
"id":"1-2"
}
}'
Sample response body:
{
"shortName": "GRP",
"leader": {
"login": "john.doe",
"name": "John Doe",
"id": "1-2"
},
"name": "GRA Project",
"id": "0-7"
}