0

I tried to get the rate of my JIRA worklogs with a python script. I have the Tempo Timesheet plugin with API for base, timesheets, accounts and teams. Everything is up to date. This is my prefered process:

  1. Get worklogs

    /rest/api/latest/worklogs?[params]
    
  2. Get account key of worklog over the issue

    /rest/api/latest/issue/[issue_key]
    
  3. Get account data

    /rest/tempo-accounts/1/account/key/[account_key]
    
  4. Get member role

    /rest/tempo-teams/2/team/1/member
    

(loop beans and search for member of the worklog)

  1. Now I have the account key and the member role id. Which API call helps me to get the related rate and currency?

In the docs is written, that the call

/rest/tempo-accounts/1/account/key/[account_key]

should response the ratetable id:

https://tempo.io/doc/accounts/api/rest/latest/#1463521625

With this information, I could extract everything from

/rest/tempo-accounts/1/ratetable/global/

In my case, this doens't work. There is no ratetable entry in the account response. Could this be a permission issue? Does anyone of you know a smarter way to get the rate and currency of a worklog?

  • Do you have any Rates set up in Tempo at all? Note that you will need *Tempo Rate Administrators* permission to view and add Rates. – altern Sep 13 '17 at 16:09
  • Yes I have set up multiple rate tables with some rates in Jira. I used the rate table functions for a long time in Tempo and inside Jira, it works. I built a workaround, but it has a very bad style: 1. read in all rate tables 2. Get the scope of each rate table (=list of account ids) 3. Search in the scope for the account id, I got by the issue. 4. If I found a match -> go through all rates of the ratetable and compare the link type with "TEAM_ROLE" and the link id with the member role id. 5. When there is a match, I have the amount and the currency. This costs lots of http requests.. – Niklas Erdmann Sep 14 '17 at 13:41

0 Answers0