As many have said, there's no direct way. However, if you narrow down the search space efficiently, it's not so bad. The following PHP code runs quite fast on my setup, but of course, your mileage may vary:
<?php
$server = 'jira.myserver.com';
$fromDate = '2012-01-01';
$toDate = '2012-01-31';
$project = 'X';
$assignee = 'bob';
$username = 'my_name';
$password = 'my_password';
$curl = curl_init();
curl_setopt($curl, CURLOPT_USERPWD, "$username:$password");
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, 0);
# Give me up to 1000 search results with the Key, where
# assignee = $assignee AND project = $project
# AND created < $toDate AND updated > $fromDate
# AND timespent > 0
curl_setopt($curl, CURLOPT_URL,
"https://$server/rest/api/2/search?startIndex=0&jql=".
"assignee+%3D+$assignee+and+project+%3D+$project+".
"and+created+%3C+$toDate+and+updated+%3E+$fromDate+".
"and+timespent+%3E+0&fields=key&maxResults=1000");
$issues = json_decode(curl_exec($curl), true);
foreach ($issues['issues'] as $issue) {
$key = $issue['key'];
# for each issue in result, give me the full worklog for that issue
curl_setopt($curl, CURLOPT_URL,
"https://$server/rest/api/2/issue/$key/worklog");
$worklog = json_decode(curl_exec($curl), true);
foreach ($worklog['worklogs'] as $entry) {
$shortDate = substr($entry['started'], 0, 10);
# keep a worklog entry on $key item,
# iff within the search time period
if ($shortDate >= $fromDate && $shortDate <= $toDate)
$periodLog[$key][] = $entry;
}
}
# Show Result:
# echo json_encode($periodLog);
# var_dump($periodLog);
?>