Tempo update broken script


Since upgrading to tempo version the bellow script fails:

import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.worklog.Worklog
import com.onresolve.scriptrunner.runner.customisers.PluginModule
import com.onresolve.scriptrunner.runner.customisers.WithPlugin
import com.tempoplugin.worklog.attribute.WorklogAttributeService


WorklogAttributeService worklogAttributeService

def worklogManager = ComponentAccessor.getWorklogManager()
def worklogs = worklogManager.getByIssue(issue)

worklogs.findAll { worklog ->
.sum { Worklog worklog ->
} as Long

// if no ChargeableWork worklogs just return null

Specifically I get an error with this line:

import com.tempoplugin.worklog.attribute.WorklogAttributeService

Unable to resolve class. Any help you can offer would be great.


1 answer

Hi Rich,

There were made some changes to the Java API.

Instead of: com.tempoplugin.worklog.attribute.WorklogAttributeService

We are now using: com.tempoplugin.core.workattribute.api.WorkAttributeService

I hope this helps.

Best regards,

Thanks for the reply,


I've modified the scrip, but now it errors out on this line:


*Error - Cannot find matching method

Have I made a syntax error here?

These are the functions we're using with the latest release of Tempo Timesheets:

ServiceOutcome<WorkAttribute> createWorkAttribute(WorkAttribute workAttribute);

    ServiceOutcome<WorkAttribute> updateWorkAttribute(WorkAttribute workAttribute);

    ServiceOutcome<Boolean> deleteWorkAttribute(int id);

    ServiceOutcome<Collection<WorkAttribute>> getWorkAttributes();

    ServiceOutcome<WorkAttribute> getWorkAttributeById(int id);

    ServiceOutcome<WorkAttribute> getWorkAttributeByKey(String key);

    ServiceOutcome<Collection<WorkAttribute>> getWorkAttributesByType(WorkAttributeType.Type type);

    ServiceOutcome<Collection<WorkAttributeType>> getWorkAttributeTypes();

I hope this helps you fix this error.


Best regards,



I have the same problem. Did you use getWorkAttributeById() to resolve the error?

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Aug 13, 2018 in Jira Service Desk

Jira Service Desk – Don’t be afraid, the journey begins with curiosity!

...be more productive while being fun to use at the same time. For some, getting started can be a bit intimidating. This is especially true if Jira Service Desk is your first exposure to Atlassian...

37,410 views 13 39
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