A PHP SDK to facilitate working with Atlassian's Tempo servlet API
This package provides a (currently) super simple interface to allow retrieval of Tempo worklogs from the Atlassian JIRA Tempo servlet API.
composer to get the job done:
composer require causelabs/tempo-php-sdk
Using the API consists of two steps: creating a transport client, and passing it into the API.
It's easiest to simply used the included Guzzle-based client. If you want to create your own, simply implement
use CauseLabs\TempoAPI\GuzzleClient; $url = 'https://yourjirainstance.jira.com'; $key = 'your-tempo-api-key'; $client = new GuzzleClient($url, $key);
After instantiating a client, you can set up the API connection:
use CauseLabs\TempoAPI\GuzzleClient; use CauseLabs\TempoAPI\API; $url = 'https://yourjirainstance.jira.com'; $key = 'your-tempo-api-key'; $client = new GuzzleClient($url, $key); $api = new API($client); // Get worklogs for a specific user $username = 'john_doe'; $start = new DateTime; $end = new DateTime; $worklogs = $api->worklogs($username, $start, $end);
Contact Mark Horlbeck at firstname.lastname@example.org for contributions, questions, etc.