Skip to main content
Skip table of contents

Workload and Holiday Scheme REST APIs for Jira Cloud

The code examples provided below are for curl and you will need to adapt them to your preferred means of dealing with REST APIs. All information provided in curly brackets “{}” need to be replaced with the variables from your instance.

Workload Schemes

Workload schemes can be created through the REST APIs. The API allows you to create a workload scheme and populate the associated scheme in one single API call. An API call looks like this:

CODE
curl --request POST 'https://api.tempo.io/core/3/workload-schemes' \
-H 'Authorization: Bearer {TempoAuthorisationToken}' \
-H 'Content-Type: text/plain' \
--data-raw '{"name": "40h workload scheme",\
"days": [ \
    {"day": "MONDAY","requiredSeconds": 28800},\
    {"day": "TUESDAY","requiredSeconds": 28800},\
    {"day": "WEDNESDAY","requiredSeconds": 28800},\
    {"day": "THURSDAY","requiredSeconds": 28800},\
    {"day": "FRIDAY","requiredSeconds": 28800},\
    {"day": "SATURDAY","requiredSeconds": 0},\
    {"day": "SUNDAY","requiredSeconds": 0}\
]}'

More detailed information on the workload API can be found in the REST API documentation.

Holiday Schemes

Holiday schemes need to be created in two steps as they can't be created and be populated at the same time. To create a holiday scheme you should run:

CODE
curl --request POST 'https://api.tempo.io/core/3//holiday-schemes' \
-H 'Authorization: Bearer {TempoAuthorisationToken}' \
-H 'Content-Type: text/plain' \
--data-raw '{"name": "European holiday scheme","description": "Holiday scheme for Europe"}'

Once you have created a holiday scheme you can retrieve the ID of the created holiday scheme in the response. This can look like:

CODE
"id": 123

You will need the ID to populate the scheme with fixed holidays (which always occur on the same date every single year) and floating holidays (which always occur on a different date each year). Floating holidays need to be created for each single year where they apply (as long as they don't fall on a weekend or any other non-workday).

CODE
curl --request POST 'https://api.tempo.io/core/3/holiday-schemes/{id}/holidays' \
-H 'Authorization: Bearer {TempoAuthorisationToken}' \
-H 'Content-Type: text/plain' \
--data-raw '{"type": "FIXED","name": "Christmas Eve","description": "The day before Christmas","durationSeconds": 28800,"date": "2021-12-24"}'

The “type” needs to be “FIXED“ or “FLOATING“ and you can only submit ONE holiday at a time. This means that you need to repeat the API call for every single holiday that will be marked as a non-workday and that will reduce time from the required workload.

Finally you will need to assign your users to holiday scheme:

CODE
curl --request POST 'https://api.tempo.io/core/3/holiday-schemes/{id}/members' \
-H 'Authorization: Bearer {TempoAuthorisationToken}' \
-H 'Content-Type: text/plain' \
--data-raw '[{"accountIds":{"accountId":"AtlassianAccountID","accountId":"AtlassianAccountID"}}]'

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.