Import Tempo rest api to display commitmentPercent and Role name

Hi all,
Im trying to finish my first Tempo custom report and to do that, I have to import and use the tempo fields : commitmentPercent and Role name. For other tempo data, i have succesfully used the addons settings in jira import source.
From Tempo docs, I have to use the “https://api.tempo.io/4/team-memberships/team/{teamId}” and the result (json) is :

{
"metadata": {
"count": 1
},
"results": [
{
"commitmentPercent": 50,
"from": "2019-08-24",
"id": 2,
"member": {
"accountId": "123456:01234567-89ab-cdef-0123-456789abcdef",
"self": "https://api.tempo.io/[...]"
},
"role": {
"id": 2,
"name": "Developer",
"self": "https://api.tempo.io/[...]"
},
"self": "https://api.tempo.io/[...]",
"team": {
"id": 12345,
"name": "Team new adventure",
"self": "https://api.tempo.io/[...]"
},
"to": "2019-08-24"
}
],
"self": "https://api.tempo.io/[...]"
}

So i add a new source as rest api and now im stack at Cube and dimention page. what settings will i have to use here, to diplay Team Name, Role, User name and commitment Percent in rows? Right now i display only Team name and Users.For columns, i have Time and Measures.

Regards
George

1 Like

Hi, George,

This use case currently seems not possible with the additional data import.
It is not allowed to map external data sources to a multiple value dimension, e.g., Logged by Team, and it is not possible to create new dimensions in the standard Jira Issues data cube with additional data import.

We have a feature request to implement the Tempo Roles as a standard dimension, but so far, we have not found a feasible solution.

Kindly,
Janis, eazyBI support

1 Like

I was able to somewhat achieve import of Tempo Role through Tempo API with Tempo Planner in use (no timesheet). I imported Tempo Role as a property of Logged By as a property of “User”. Now I’m able to use page filters to split Tempo Planner hours logged by Role.

1 Like

Hi again to all! I will write down the implementation, and maybe the EazyBI team can use this in their Tempo Planner doc page

  1. Create rest API source

  2. Use this URL to fetch team-memberships: https://api.tempo.io/4/team-memberships/search?limit=1000

  3. Request method: Post

  4. Request body: this will be basically empty, but include the curly braces characters only: {}

  5. Pagination: Next page URL. Next page URL property: metadata.next

  6. Authentication params: HTTP header, with header name as Authorization. Header value will be “Bearer (token here)”

  7. Content type: JSON

  8. Data path: $.results

  9. Custom javascript code: use with care and verify results

    // Create a clean, flat object to pass to the mapping screen
    var cleanData = {
    // Fallback checks handle both nested and eazyBI-flattened states
    accountId: doc.member ? doc.member.accountId : doc[“member\naccountId”],
    tempoRole: doc.role ? doc.role.name : doc[“role\nname”],
    tempoTeam: doc.team ? doc.team.name : doc[“team\nname”],
    commitment: doc.commitmentPercent || 0
    };
    
    // Return only the clean data, discarding all other Tempo API metadata
    return cleanData;
    
  10. Continue to the import settings. Stat by using the Issues cube, then apply these values to the import settings. We do not use “commitment” or tempoTeam at this moment, only the accountId and tempoRole

Field name: accountId tempoRole tempoTeam commitment
Data type: string string string integer
Dimension: Logged by Logged by
Level or Measure: User User
Advanced options: Key column
Skip missing
Property name
Tempo Role

If all went well, you can go to the Logged By dimension in a dummy report, and click “All hierarchy level members” and click “Add custom hierarchy” and select “Tempo Role” from the dropdown. That should be it!