What am I doing wrong - Tempo API Update error?

Aleksander Stós November 28, 2016

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
Answer accepted
Susanne Götz [Tempo]
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 29, 2016

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

Aleksander Stós November 29, 2016

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 

0 votes
Vasiliy Zverev
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 28, 2016

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

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events