What am I doing wrong - Tempo API Update error?

I'm trying to update my worklog via Tempo API, but it returns 500 - java.lang.NullPointerException

Request: https://{name}.atlassian.net/rest/tempo-timesheets/3/worklogs/{worklogid}/

body:  {
    timeSpentSeconds: 3000
}

headers: {
    Authorization: Basic: {key}
}

Any ideas what am I doing wrong?

 

Longer error stack:

java.lang.NullPointerException
	at com.tempoplugin.worklog.restv3.WorklogsResource$UpdateBeanValidator.getWorklogBuilder(WorklogsResource.java:432)
	at com.tempoplugin.worklog.restv3.WorklogsResource$BeanValidator.validate(WorklogsResource.java:379)
	at com.tempoplugin.worklog.restv3.WorklogsResource.updateWorklog(WorklogsResource.java:235)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at com.atlassian.plugins.rest.common.interceptor.impl.DispatchProviderHelper$ResponseOutInvoker$1.invoke(DispatchProviderHelper.java:192)
	at com.atlassian.plugins.rest.common.interceptor.impl.DispatchProviderHelper$1.intercept(DispatchProviderHelper.java:83)
	at com.atlassian.plugins.rest.common.interceptor.impl.DefaultMethodInvocation.invoke(DefaultMethodInvocation.java:53)
	at com.atlassian.plugins.rest.common.expand.interceptor.ExpandInterceptor.intercept(ExpandInterceptor.java:41)
	at com.atlassian.plugins.rest.common.interceptor.impl.DefaultMethodInvocation.invoke(DefaultMethodInvocation.java:53)
	at com.atlassian.plugins.rest.common.interceptor.impl.DispatchProviderHelper.invokeMethodWithInterceptors(DispatchProviderHelper.java:110)
	at com.atlassian.plugins.rest.common.interceptor.impl.DispatchProviderHelper$ResponseOutInvoker._dispatch(DispatchProviderHelper.java:190)
	at com.sun.jersey.server.impl.model.method.dispatch.ResourceJavaMethodDispatcher.dispatch(ResourceJavaMethodDispatcher.java:75)
	at com.sun.jersey.server.impl.uri.rules.HttpMethodRule.accept(HttpMethodRule.java:302)
	at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147)
	at com.sun.jersey.server.impl.uri.rules.ResourceClassRule.accept(ResourceClassRule.java:108)
	at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147)
	at 
(...)

2 answers

1 accepted

0 votes
Accepted answer

Hi Alexander, 

can you change the body of your PUT request to: 

{
     "timeSpentSeconds": 14400,
     "issue":{
      }
}

 

Please note that you need to add that this is of Content-Type  application/json

Regards,

Susanne

Thanks a lot, that's what I needed!

It would be nice to update the api documentation about the fields that are required:
http://tempo.io/doc/timesheets/api/rest/latest/#2025206437 

Are you sure that Tempo plugin version is compatible to your JIRA version?

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Feb 07, 2019 in Marketplace Apps

A Timeless Love Story

It started as any story starts, on a normal, rainy day.   Admin meets App, and her name was Klok2, and like any first relationship we were both trying to make it work but neither one knew what...

452 views 8 26
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