Can I add holidays to holidayscheme via REST api?

I'm experimenting with these URLs.

http://localhost:8080/rest/tempo-core/1/holidayscheme/{schemeId}/days/{type}

http://localhost:8080/rest/tempo-core/1/holidayscheme/{schemeId}/days/{type}/{id}

Both have post or put methods which would indicate that I can add new holidays via rest api. Although I have not figured out what's the correct request body.

What I've tried:

{"id":504,"schemeId":21,"name":"Test","description":"testing","duration":"1d","type":"fixed","date":"24/Sept"}

 

EDIT

Finally got it, one has to do raw post method and add following as parameters

{"name": "test123", "description": "test123", "duration": "1d", "date": "25/Sep"}

2 answers

Hi,

Currently, there is no documentation about the API´s of the System Plugin: Tempo Core. This API is available in the JIRA REST API Browser and is listed as a private API. 

Please note that private API´s are subject to change.

Regards,

Susanne

 

Hello,

I'm new to Tempo vs REST API. How does a complete POST call look like in order to create a new vacation day?

I don't understand whether the fields you listed in the mentioned JSON are after all like fields in a form post or the JSON is somehow the POST body itself?

I'm trying to make a workaround for TT-535 by requiring working 8h for all Saturdays (by the workload scheme) and set all non-working Saturdays as vacations (instead of setting one, setting 51 in the other direction). I'm not willing to do it manually (will need it next year too), will rather write a script for that.

Thanks,

Sandor

EDIT

I see the JSON needs to be the request body itself.
Headers:
Content-type: application/json
Content-length: {json string length}

The url looks to be like:

{host}/rest/tempo-core/1/holidayscheme/{scheme id}

 

the verb shoud be PUT (refuses POST)

the json body accepts name and description fields, but adding date, type or duration results  HTTP 500.

It was just experimenting, any comprehensive doc would be a great relief to me.

Succeeded!

Just to not leave the question open, decode this request to any language you are implementing it in:

curl -u {user}:{pass} -X POST -H "Content-Type: application/json" {host}/rest/tempo-core/1/holidayscheme/{schema id}/days/{floating|fixed} --data-raw '{"name":"test","description":"Added thru REST API","duration":"1d","date":"23/Mar/18"}'

Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Bridget Sauer
Published Apr 19, 2018 in Marketplace Apps

Calling all developers––You're invited to Atlas Camp 2018

 Atlas Camp   is our developer event which will take place in Barcelona, Spain  from the 6th -7th of   September . This is a great opportunity to meet other developers and get n...

366 views 0 6
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you