Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Deleted user
Level
0 / 0 points
Next:
badges earned

Your Points Tracker
Challenges
Leaderboard
  • Global
  • Feed

Badge for your thoughts?

You're enrolled in our new beta rewards program. Join our group to get the inside scoop and share your feedback.

Join group
Recognition
Give the gift of kudos
You have 0 kudos available to give
Who do you want to recognize?
Why do you want to recognize them?
Kudos
Great job appreciating your peers!
Check back soon to give more kudos.

Past Kudos Given
No kudos given
You haven't given any kudos yet. Share the love above and you'll see it here.

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Tempo Java API documentation

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

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

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

Hi! 

 

I'll do it

Thanks

 

Cheers,

Gonchik Tsymzhitov

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!

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

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.

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
Community showcase
Published in Marketplace Apps & Integrations

New Cloud Apps Roundup - April 2021

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...

254 views 3 20
Read article

Community Events

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

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you