I set up an automation which is called every time someone logs work.
I use a web request https://api.personio.de/v1/auth to Personio's API to receive a token. With this token I can use https://api.personio.de/v1/company/employees to get the employees id using Jira's smart value {{initiator.emailAddress}}.
I send a third web request to receive a new token. So far so good ...
With the forth request and the new token I want to use POST and https://api.personio.de/v1/company/attendances to log the time. Here I get the response from Personio {"success":false,"error":{"message":"personio.core.api.exceptions.api.forbidden.http.exception","code":0}}
Can anyone help?
Hi Moritz,
I'm having some issues with the employees endpoint but I could make the attendance one work with the setup below:
Headers: Authorization, accept, content-type
Method post
Web Request body:
{
"attendances":[
{
"employee":{{ids.get(initiator.emailAddress)}},
"date":"{{now.jiraDate}}",
"start_time":"{{worklog.started.convertToTimeZone("Europe/Rome").format("HH:mm")}}",
"end_time":"{{worklog.started.convertToTimeZone("Europe/Rome").plusSeconds(worklog.timeSpentSeconds).format("HH:mm")}}",
"break":0,
"project_id":{{projects.get(issue.Personio Project)}},
"comment":"{{worklog.comment}}"
}
]
}
I hope it helps!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.