-
Notifications
You must be signed in to change notification settings - Fork 0
Description
Hi,
Testing under the development branch, timesheet reports seem to be on a per-workspace basis.
It would be useful to be able to run a daily report across multiple workspaces (for example for tracking time across multiple projects for one billable entity) or run a report on specific workspaces without switching to them individually.
Today, I have three active workspaces (split by project, chargeable to one company) with time spent on tickets logged under each one. To send my daily report, I had to tid stop and cycle through the workspaces running tid report on each one.
Example data:
% tid workspace ls
default
DPC00005 *
Support
DPC00032
% tid timesheet ls
+------------+---------+----------+
| DATE | ENTRIES | DURATION |
+------------+---------+----------+
| 2017-04-18 | 4 | 6h56m27s |
+------------+ + +
| TOTAL | | |
+------------+---------+----------+The bash script below meets the feature request in a roundabout way (list the workspaces and find which one you're on at the moment, find your currently active check-in, loop through workspaces running a report on each and then resume your active check-in).
#!/usr/bin/env bash
set -euo pipefail;
WORKSPACES=$(tid workspace ls | awk '{ print $1 }');
ACTIVE=$(tid workspace ls | grep '*' | awk '{ print $1 }');
STATUS=$(tid status -f="{{.IsRunning}}");
TASK=$(tid status -f="{{.ShortHash}}");
if [[ $STATUS == "true" ]];
then
echo "Stopping tid timer...";
tid stop;
fi
for ws in ${WORKSPACES[@]};
do
tid workspace switch $ws > /dev/null;
report=$(tid report);
if [[ "$report" != "report: No entries within the given time period" ]];
then
echo "
Project $ws
$report";
fi
done
if [[ $STATUS == "true" ]];
then
echo "Resuming tid timer (ShortHash $TASK on workspace $ACTIVE)...";
tid workspace switch $ACTIVE;
tid resume $TASK;
fiThanks,
Mike