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

Version 1 Next »

Overview

Each vacation type could have defined default values - automatically assigned vacation days for new users.

Methods

POST

 Create default values

Creates default values for vacation type.

Path

POST {jira_baseurl}/rest/vacation-manager/1.0/vacation-type/default-values

Permissions

ADMIN USER SUPERVISOR HR

JSON body fields

NameTypeDescription
idintObject Id
vacationTypeIdintVacation Type Id
daysCountLimitdoubleNumber of days that will be assigned to user
defaultPeriodTypeVacationTypeDefaultPeriodType

One of values:

  • ONE_TIME_DYNAMIC_DAYS_OFFSET
  • ONE_TIME_FIXED_DAYS_OFFSET
  • RECURRING_PERIOD_OFFSET
  • RECURRING_DYNAMIC_OFFSET
  • RECURRING_FIXED_OFFSET
dynamicOffsetString

Start date offset of vacation days after user is added to Vacation Manager, 1m 1w 1d format

(required for DYNAMIC defaultPeriodType)

dynamicDaysint

End date offset from dynamicOffset

(required for DYNAMIC defaultPeriodType)

fixedStartDateString

Start date of vacation days, YYYY-MM-DD format

(required for FIXED defaultPeriodType)

fixedEndDateString

End date of vacation days, YYYY-MM-DD format

(required for FIXED defaultPeriodType)

periodOffsetint

Start date offset in periods for new vacation days.

0 - current period

-1, -2... - previous periods

1, 2... - next periods

(required for PERIOD defaultPeriodType)


Responses

201 404 500

Example

 Example
Path
POST {jira_baseurl}/rest/vacation-manager/1.0/vacation-type/default-values
Body
{
  "vacationTypeId": 2,
  "daysCountLimit": 20,
  "defaultPeriodType": "RECURRING_PERIOD_OFFSET",
  "periodOffset": 2
}
Response
{
  "id": 2,
  "vacationTypeId": 2,
  "daysCountLimit": 20.0,
  "defaultPeriodType": "RECURRING_PERIOD_OFFSET",
  "periodOffset": 2
}


GET

 Get all default values

Returns list of all default values.

Path

GET {jira_baseurl}/rest/vacation-manager/1.0/vacation-type/default-values

Permissions

ADMIN USER SUPERVISOR HR

Responses

200 500

Example

 Example
Path
GET {jira_baseurl}/rest/vacation-manager/1.0/vacation-type/default-values
Response
[
    {
        "id": 1,
        "vacationTypeId": 1,
        "daysCountLimit": 1.0,
        "defaultPeriodType": "ONE_TIME_DYNAMIC_DAYS_OFFSET",
        "dynamicOffset": "1",
        "dynamicDays": 1
    },
    {
        "id": 2,
        "vacationTypeId": 2,
        "daysCountLimit": 20.0,
        "defaultPeriodType": "RECURRING_PERIOD_OFFSET",
        "periodOffset": 2
    }
]

 Get default values object by Id

Returns default value object by its Id.

Path

GET {jira_baseurl}/rest/vacation-manager/1.0/vacation-type/default-values/{defaultValueId}

Permissions

ADMIN USER SUPERVISOR HR

Path params

NameTypeDescription
defaultValueIdintId of default value object

Responses

200 404 500

Example

 Example
Path
GET {jira_baseurl}/rest/vacation-manager/1.0/vacation-type/default-values/1
Response
{
    "id": 1,
    "vacationTypeId": 1,
    "daysCountLimit": 1.0,
    "defaultPeriodType": "ONE_TIME_DYNAMIC_DAYS_OFFSET",
    "dynamicOffset": "1",
    "dynamicDays": 1
}

 Get default values object by Vacation Type

Returns default value object by Vacation Type that it's assigned to.

Path

GET {jira_baseurl}/rest/vacation-manager/1.0/vacation-type/default-values/by-vacation-type/{vacationTypeId}

Permissions

ADMIN USER SUPERVISOR HR

Path params

NameTypeDescription
vacationTypeIdintId of vacation type

Responses

200 404 500

Example

 Example
Path
GET {jira_baseurl}/rest/vacation-manager/1.0/vacation-type/default-values/by-vacation-type/1
Response
[
    {
        "id": 1,
        "vacationTypeId": 1,
        "daysCountLimit": 1.0,
        "defaultPeriodType": "ONE_TIME_DYNAMIC_DAYS_OFFSET",
        "dynamicOffset": "1",
        "dynamicDays": 1
    }
]

PUT

 Update default values

Updates and returns default values object.

Path

PUT {jira_baseurl}/rest/vacation-manager/1.0/vacation-type/default-values/{defaultValuesId}

Permissions

ADMIN USER SUPERVISOR HR

Path params

NameTypeDescription
defaultValuesIdintId of default values object to update

JSON body fields

Same as in create default values endpoint.

Responses

200 400 404 500

Example

 Example
Path
PUT {jira_baseurl}/rest/vacation-manager/1.0/vacation-type/default-values/2
Body
{
  "vacationTypeId": 2,
  "daysCountLimit": 25,
  "defaultPeriodType": "RECURRING_PERIOD_OFFSET",
  "periodOffset": 2
}
Response
{
    "id": 2,
    "vacationTypeId": 2,
    "daysCountLimit": 25.0,
    "defaultPeriodType": "RECURRING_PERIOD_OFFSET",
    "periodOffset": 2
}

DELETE

 Delete default values object by Id

Deletes default values object.

Path

DELETE {jira_baseurl}/rest/vacation-manager/1.0/vacation-type/default-values/{defaultValuesId}

Permissions

ADMIN USER SUPERVISOR HR

Path params

NameTypeDescription
defaultValuesIdintId of default values object

Responses

204 404 500

 Example
Path
DELETE {jira_baseurl}/rest/vacation-manager/1.0/vacation-type/default-values/3

 Delete default values object for vacation type

Deletes default values object for given vacation type.

Path

DELETE {jira_baseurl}/rest/vacation-manager/1.0/vacation-type/default-values/by-vacation-type/{vacationTypeId}

Permissions

ADMIN USER SUPERVISOR HR

Path params

NameTypeDescription
vacationTypeIdintId of vacation type object to delete default values object from

Responses

204 404 500

 Example
Path
DELETE {jira_baseurl}/rest/vacation-manager/1.0/vacation-type/default-values/by-vacation-type/5
  • No labels