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.
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
@WithPlugin("com.tempoplugin.tempo-accounts")
@PluginModule
AccountService accountService
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi!
I'll do it
Thanks
Cheers,
Gonchik Tsymzhitov
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.