Tempo Java API documentation

Ivana Navratilova September 10, 2018

Hello, I am currently maintaining big legacy project that uses Tempo Java API, i.e. tempo-accounts.

@WithPlugin("com.tempoplugin.tempo-accounts")
def accountService = ComponentAccessor.getOSGiComponentInstanceOfType(AccountService)

I have been absolutely unable to find any kind of documentation for Java API - there is a lot of it covering the REST APIs, but nothing on Java. Are there some sources that are maybe not public, or I just havent had luck finding?

I am currently mainly interested in this

com.tempoplugin.accounts.account.api.Account

class, but I will probably need others as well in the future.

4 answers

1 accepted

0 votes
Answer accepted
Gonchik Tsymzhitov
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
September 12, 2018

Hi! 

 

I am trying to get like this: 

@WithPlugin("com.tempoplugin.accounts.account.api")

@PluginModule
AccountService accountService

Unfortunately, it does not work. 

Have you found any solution?

 

Cheers,

Gonchik Tsymzhitov

Gonchik Tsymzhitov
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 15, 2019

@WithPlugin("com.tempoplugin.tempo-accounts")

@PluginModule
AccountService accountService
1 vote
Loïc Dewerchin April 9, 2019

Hello,

I faced the same problem , joined the Tempo Developers slack but did not receive any feedback on my question concerning the Java Tempo API and my problem with working with Accounts.

 

Posting my solution here in the hope somebody with similar problems will find it useful.  

In general when working with Tempo Java API we don't have any public information , no javadocs like https://docs.atlassian.com/software/jira/docs/api/7.12.1/  to work with.

 

We use Scriptrunner , check this to work with Tempo in Scriptrunner: https://scriptrunner.adaptavist.com/latest/jira/plugins/working-with-tempo.html .

 

To work with accounts , use something like this, in my use case I wanted to get the Accounts coupled to Jira projects :

 

 

import com.onresolve.scriptrunner.runner.customisers.PluginModule
import com.tempoplugin.accounts.account.api.*
import com.atlassian.jira.bc.ServiceOutcome


@WithPlugin("is.origo.jira.tempo-plugin") 
@PluginModule
AccountService accountService


Collection<Account> projectAccounts =  accountService.getAccountsByProject(issue.getProjectId()).get()
....

 

It's a pain to hunt down the classes and methods you need to perform your automation with Tempo , let's hope they will make the Javadocs public for us in the future.

 

good luck!

Greg Fischer July 19, 2019

Hi Loic,

 

I tried your code in a workflow post-transition ScriptRunner Groovy script and although the script editor shows green, when it executes I keep getting a java.lang.NoClassDefFoundError: com/tempoplugin/accounts/account/api/AccountService error.  Any thoughts?

 

Thanks,

-Greg

Loïc Dewerchin August 5, 2019

Hey Greg,

 

I vaguely remember getting the same kind of errors when working the AccountLink class and subclasses when working with Tempo and scripting. I didn't have time to look at this in depth but if I remember correctly the problem was solved by importing the classes/subclasses directly and not working with the star like this.

 

import com.tempoplugin.accounts.account.api.*

(Although this works for me)

Also , just to be sure , you import like this:

@WithPlugin("is.origo.jira.tempo-plugin")

@PluginModule
AccountService accountService

Also , the last get() in code above is because the first call returns a ServiceOutcome object , so you have to import that one too, I will update the example :

import com.atlassian.jira.bc.ServiceOutcome

 

Last thing I can think off is that I had some problems in the past when working with inline code for the scripts, since then I always work with files in the server (which is cleaner and beter maintainable anyway)

 

Good luck, hope you find your problem.

1 vote
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.
September 12, 2018

Hi,

There is no public documentation for the Tempo java API's.

I recommend joining the Tempo Ecosystem community on Slack where you can get support from Tempo developers and other developers building with Tempo.

To register, please go to https://www.tempo.io/developers and join the developer community.

Regards,
Susanne Götz
Tempo team

Gonchik Tsymzhitov
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
September 12, 2018

Hi! 

 

I'll do it

Thanks

 

Cheers,

Gonchik Tsymzhitov

0 votes
Jens Kisters //SeibertSolutions
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.
September 8, 2020

Hi all,

FYI

As there still is no sign theres a documented Java API and i couldnt find anything in the Adaptavist library that matched my use case "reading billable time"

i am solving this by creating a Script Runner scripted field that pull the data via Tempos REST API for one issue.

I hope our users wont use this for hundreds or thousands of issues...

 

Cheers

Jens

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events