Hello, I am currently maintaining big legacy project that uses Tempo Java API, i.e. 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
class, but I will probably need others as well in the future.
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.
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 :
Collection<Account> projectAccounts = accountService.getAccountsByProject(issue.getProjectId()).
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.
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?
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.
(Although this works for me)
Also , just to be sure , you import like this:
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 :
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.
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...
Atlassian's marketplace partners have had a very productive start to 2021! Since our last roundup, our developer community has added over 160 new cloud apps to the Atlassian Marketplace to help you...
Connect with like-minded Atlassian users at free events near you!Find an event
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no Community Events near you at the moment.Host an event