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

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
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
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