Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 10 Next »

GET

Get teams list

Get list of all teams.

Permissions: ADMIN USER SUPERVISOR HR

GET {jira_baseurl}/rest/vacation-manager/1.0/team

Responses: 200 500

 Example
Path
GET {jira_baseurl}/rest/vacation-manager/1.0/team
Request
[
    {
        "id": 1,
        "name": "team 1",
        "description": "description 1"
    },
    {
        "id": 2,
        "name": "team 2",
        "description": "description 2"
    },
    {
        "id": 3,
        "name": "team 3",
        "description": "description 3"
    }
]

Get single team

Get information about existing team members.

Permissions: ADMIN USER SUPERVISOR HR

GET {jira_baseurl}/rest/vacation-manager/1.0/team/{teamId}

Responses: 200 404 500

Path params

Name

Type

Description

teamId

int

Team ID

 Example
Path
GET {jira_baseurl}/rest/vacation-manager/1.0/team/1
Response
{
  "id": 1,
  "name": "teamName",
  "description": "description",
  "users": [
    {
      "id": 1,
      "name": "user 1",
      "displayName": "User 1",
      "active": true
    },
    {
      "id": 2,
      "name": "user 2",
      "displayName": "User 2",
      "active": true
    },
    {
      "id": 3,
      "name": "user 3",
      "displayName": "User 3",
      "active": true
    }
  ],
  "supervisors": [
    {
      "id": 4,
      "name": "supervisor 1",
      "displayName": "Supervisor 1",
      "active": true
    }
  ]
}

Get team members

Get information about existing team.

Permissions: ADMIN USER SUPERVISOR HR

GET {jira_baseurl}/rest/vacation-manager/1.0/team/{teamId}/member

Responses: 200 400 500

Path params

Name

Type

Description

teamId

int

Team ID

 Example
Path
GET {jira_baseurl}/rest/vacation-manager/1.0/team/1/member
Response
{
    "id": 1,
    "name": "teamName",
    "description": "description",
    "user": {
        "users": [
			{
                "id": 1,
                "userId": 10,
                "role": "USER",
                "teamId": 1
			},
			{
                "id": 2,
                "userId": 20,
                "role": "USER",
                "teamId": 1
			},
			{
                "id": 3,
                "userId": 30,
                "role": "USER",
                "teamId": 1
			}
		],
        "groups": [
            {
                "id": 7,
                "groupName": "users",
                "role": "USER",
                "teamId": 1
            }
        ]
    },
    "supervisor": {
        "users": [
			{
                "id": 4,
                "userId": 40,
                "role": "SUPERVISOR",
                "teamId": 1
			},
			{
                "id": 5,
                "userId": 50,
                "role": "SUPERVISOR",
                "teamId": 1
			},
			{
                "id": 6,
                "userId": 60,
                "role": "SUPERVISOR",
                "teamId": 1
			}
		],
        "groups": [
			{
                "id": 8,
                "groupName": "supervisors",
                "role": "SUPERVISOR",
                "teamId": 1
            }
		]
    }
}

POST

Create team

Creates new team.

Permissions: ADMIN USER SUPERVISOR HR

POST {jira_baseurl}/rest/vacation-manager/1.0/team

Responses: 201 400 500

JSON body fields

Name

Type

Description

name

String

Team name, must be unique for each team

description

String (Optional)

Team description

 Example
Path
POST {jira_baseurl}/rest/vacation-manager/1.0/team

Body

{
    "name": "Team name",
    "description": "Team Description"
}

Response

{
	"id": 
    "name": "Team name",
    "description": "Team Description"
}

Add member to team

Add member to team.

Permissions: ADMIN USER SUPERVISOR HR

POST {jira_baseurl}/rest/vacation-manager/1.0/team/{teamId}/member

Responses: 201 400 404 500

Path params

Name

Type

Description

teamId

int

Team id


JSON body fields

Name

Type

Description

type

MemberType

Type of member

name

String

Name of the member you want to add to the team

role

MemberRole

Role for member

MemberType

Name

Type

Description

USER

Enum

User type

GROUP

Enum

Group type

MemberRole

Name

Type

Description

USER

Enum

User role for member

SUPERVISOR

Enum

Supervisor role for member

 Example
Path
POST {jira_baseurl}/rest/vacation-manager/1.0/team/1/member

Add user to team

Body
{
	"type":"USER",
	"name":"user 1",
	"role":"USER"
}
Response
{
    "id": 1,
    "userId": 10000,
    "role": "USER",
    "teamId": 1
}

Add group to team

Body
{
	"type":"GROUP",
	"name":"users",
	"role":"USER"
}
Response
{
    "id": 6,
    "groupName": "users",
    "role": "USER",
    "teamId": 1
}

PATCH

Update team

Update existing team.

Permissions: ADMIN USER SUPERVISOR HR

PATCH {jira_baseurl}/rest/vacation-manager/1.0/team/{teamId}

Responses: 200 400 404 500

Path params

Name

Type

Description

teamId

int

Team ID


JSON body fields

Name

Type

Description

name

String

Team name, must be unique

description

String (Optional)

Team description

 Example
Path
PATCH {jira_baseurl}/rest/vacation-manager/1.0/team/1
Body
{
    "name": "new team name"
}
Request
{
    "id": 1,
    "name": "new team name",
    "description": "Team Description"
}

DELETE

Delete team

Delete existing team.

Permissions: ADMIN USER SUPERVISOR HR

DELETE {jira_baseurl}/rest/vacation-manager/1.0/team/{teamId}

Responses: 204 404 500

Path params

Name

Type

Description

teamId

int

Team ID

 Example
Request
DELETE {jira_baseurl}/rest/vacation-manager/1.0/team/1

Remove member from team

Remove member from team.

Permissions: ADMIN USER SUPERVISOR HR

DELETE {jira_baseurl}/rest/vacation-manager/1.0/team/{teamId}/member

Responses: 204 404 500

Path params

Name

Type

Description

teamId

int

Team ID

JSON body fields

Name

Type

Description

type

String

Type of member to remove

  • USER

  • GROUP

name

String

Name of the member you want to remove from the team

role

String

Role for member to remove

  • USER

  • SUPERVISOR

 Example
Path
DELETE {jira_baseurl}/rest/vacation-manager/1.0/team/1/member
Body
{
	"type":"GROUP",
	"name":"users",
	"role":"USER"
}
  • No labels