Use this with launchd to create digest emails for Lighthouse tickets. Example uses:
- Send a summary of stale tickets to members on your team every week.
- Get daily summaries of tickets created that day
- Get daily summaries of tickets closed that day
# Set basic Lighthouse info # Your lighthouse account name Lighthouse.account = "activereload" # Your API Key for this particular project Lighthouse.token = "YOUR TOKEN" Lighthouse::Digest.new do |digest| digest.project_id = 44 # Lighthouse project id digest.from = "firstname.lastname@example.org" # optional digest.query = "state:open updated:'three weeks ago - two weeks ago'" # Any valid Lighthouse search digest.emails = "email@example.com, firstname.lastname@example.org" # Who to send this digest too end
Here is a typical launchd script to email you once a week. Place this in ~/Library/LaunchAgents/com.lighthouseapp.project.digest.
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>Label</key> <string>com.lighthouseapp.activereload.digest</string> <key>ProgramArguments</key> <array> <string>ruby</string> <string>/Users/Caged/myscript.rb</string> </array> <key>RunAtLoad</key> <false/> <key>StartCalendarInterval</key> <dict> <key>Hour</key> <integer>0</integer> <key>Minute</key> <integer>0</integer> <key>Weekday</key> <integer>1</integer> </dict> </dict> </plist>
launchctl load ~/Library/LaunchAgents/com.lighthouseapp.PROJECT.digest
Test it using the label you give it in the plist
launchctl start com.lighthouseapp.PROJECT.digest
If you want to stop this script for good, unload it:
launchctl unload ~/Library/LaunchAgents/com.lighthouseapp.PROJECT.digest