# edit through crontab -e
JIRA_PWD=jiraPassword
JIRA_TO1=teammail1@sample.com
JIRA_TO2=teammail2@sample.com
JIRA_FROM=jira@sample.com
MAIL_SERVER=mail.sample.com:25
30 08 * * * mysql -vvv -u jira -p$JIRA_PWD jira -e 'select concat(c.pkey, "-", b.issuenum) as issuekey, AUTHOR, issueid, a.STARTDATE, timeworked / 3600 as yesterday_hours, timespent / 3600 as total_hours from worklog a inner join jiraissue b on a.issueid=b.ID inner join project c on b.PROJECT=c.id where date(a.STARTDATE) = date_sub(CURDATE(), interval 1 day) order by AUTHOR, c.pkey, b.issuenum, a.STARTDATE;' | sendEmail -f $JIRA_FROM -t $JIRA_TO1 $JIRA_TO2 -s $MAIL_SERVER -u "JIRA worklog for yesterday" > /dev/null