---
title: "Timesheets by Tempo"
canonical: "https://docs.getxporter.app/space/XPORTER/1412387/Timesheets%20by%20Tempo"
format: markdown
---
> Macro (rw-ui-expands-macro)
> 
> > Macro (rw-expand)
> 
> > Macro (toc)

## Introduction

[Xporter for Jira](https://marketplace.atlassian.com/apps/891368/xporter-export-issues-from-jira?tab=installation&hosting=datacenter) allows you to get the billed hours and attributes from each worklog entry, a field generated by and managed from the** **[**Timesheets by Tempo**](https://marketplace.atlassian.com/apps/6572/timesheets-by-tempo-jira-time-tracking) add-on.

> ❌ The steps described here are only required for** Timesheets by Tempo 8.x.x**.

Xporter for Jira integrates with** Timesheets by Tempo** via the [Tempo Servlet API](https://tempoplugin.jira.com/wiki/display/TEMPO/Tempo+servlet+manual) and [Tempo REST API](https://tempoplugin.jira.com/wiki/spaces/JTS/pages/120389685/Timesheets+REST+API). 

## Usage

### Configuration

> Macro (rw-ui-steps-macro)
> 
> > Macro (rw-step)
> 
> [Get the access token](https://tempo-io.atlassian.net/wiki/spaces/THC/pages/648839590/Access+Control+-+Tempo+Server) to allow Xporter for Jira to communicate with Timesheets by Tempo.
> 
> > Macro (rw-step)
> 
> Define the access token in your document using the [Prop function](https://confluence.getxray.app/display/public/XPORTER/Functions#Functions-Prop). The key must be `tempo.api.token`
> 
> > Macro (rw-step)
> 
> Define Tempo to export [Billed hours](https://help.tempo.io/timesheets/latest/tracking-billable-hours-on-projects): go to Tempo Administration -> Fields -> Custom Fields and select the Export billed hours option.

### Examples

#### Example 1 - Billed hours by each worklog entry

```
${prop(tempo.api.token,f66a8d4f-5b77-44d2-8973-944d643b0235)}
#{for worklogs}
   Author: ${Worklogs[n].Author}
   Comment: ${Worklogs[n].Comment}
   Time Spent: ${Worklogs[n].TimeSpentFormatted} 
   Billed hours: ${Worklogs[n].BilledHoursFormatted}
#{end}
```

#### Example 2 - Attributes by each worklog entry

> ❌ This functionality requires **Tempo Timesheets 8.13.1**

```
#{for worklogs}
   Author: ${Worklogs[n].Author}
   Comment: ${Worklogs[n].Comment}
   Time Spent: ${Worklogs[n].TimeSpentFormatted} 
   Attribute: ${Worklogs[n].My Attribute Name}
#{end}
```

### Additional Configuration

Xporter allows you to define the interval of worklogs you want to get on your reports.

The only information you will need to add to the template is the date you want to get the worklogs.

You can define the date from and the date to on your document using the Prop function.  


| **Key** | **Value** |
| --- | --- |
| tempo.api.from | Ex.: 2018-01-01 |
| tempo.api.to | Ex.: 2018-12-31 |

> ⚠️ - Both dates must have the following format: "yyyy-MM-dd".
> ⚠️ - The information that will respect this interval will be only custom fields that belongs to the Timesheets by Tempo (example: Billable Hours).

```
${prop(tempo.date.from, 2018-01-01)}
${prop(tempo.date.to, 2018-12-31)}
```

### Iterating Over Tempo Worklog Entries

Xporter allows you to iterate over tempo log entries and for each log entry it will be possible to export all the fields defined on Tempo. This allows you to create a table that dynamically grows according to the number of existing worklogs.

#### Fields

| **Tempo Fields** | **Description** |
| --- | --- |
| Author | The author of the worklog entry |
| Comment | The comment of the worklog |
| Date | The date when the worklog is registered |
| From | The time when the worklog started |
| To | The time when the worklog finished |
| Worked | The worked time in seconds |
| WorkedFormatted | The worked time as displayed on Jira |
| Billable | The billable time in seconds |
| BillableFormatted | The billable time as displayed on Jira |
| RemainingEstimate | The remaining estimated time in seconds |
| RemainingEstimateFormatted | The remaining estimated time as displayed on Jira |
| <Atribute Name> | The attribute name defined by Tempo |

##### **Notation**

```
#{for worklogs}
   Author: ${fullname:Worklogs[n].Author}
   Comment: ${Worklogs[n].Comment}
   Date: ${dateformat("dd-MM-yyyy"):Worklogs[n].Date} 
   From: ${dateformat(“HH:mm”):Worklogs[n].From}
   To: ${dateformat(“HH:mm”):Worklogs[n].To}
   Worked (Seconds): ${Worklogs[n].Worked}
   Worked: ${Worklogs[n].WorkedFormatted}
   Billable (Seconds): ${Worklogs[n].Billable}
   Billable: ${Worklogs[n].BillableFormatted}
   Remaining estimated (Seconds): ${Worklogs[n].RemainingEstimate}
   Remaining estimated: ${Worklogs[n].RemainingEstimateFormatted}
   Attribute: ${Worklogs[n].My Attribute Name}
#{end}
```

#### Log Time Example

![Figure 1 - Example](media://80048794-12da-4feb-b75c-8c2aa833e7be)

#### Generated Report

The report generated will have all the Tempo information.  
Furthermore, the report allows you to export the time as a second or formatted as displayed on JIRA.

![Figure 2 - Report](media://8569eec0-c8a8-4a29-b283-0e6b8e227759)

<details>
<summary>Support/Troubleshooting</summary>

If you have questions or technical issues, please [contact the Support team via the Customer Portal (Jira service management)](https://jira.getxray.app/servicedesk/customer/portal/2/user/login?destination=portal%2F2%2Fcreate%2F28) or [send us a message using the in-app chat](https://docs.getxporter.app/space/XPORTER/23102936).
</details>