diff options
| author | Teddy Wing | 2022-05-08 05:07:39 +0200 |
|---|---|---|
| committer | Teddy Wing | 2022-05-08 05:07:39 +0200 |
| commit | 22461379250147870550d4d9cd43dc67f65892a9 (patch) | |
| tree | 8c9a66ff3c071868b86c81528c896c1e196f2130 /src/main.lisp | |
| parent | 8d98dd58afdbf659b6c246f158451cd8c850acb8 (diff) | |
| download | wajir-22461379250147870550d4d9cd43dc67f65892a9.tar.bz2 | |
Start of email building
Take a recipient email address. Build an email containing the issue
details.
Change the `run` loop to only operate on a single issue for testing
purposes.
Diffstat (limited to 'src/main.lisp')
| -rw-r--r-- | src/main.lisp | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/src/main.lisp b/src/main.lisp index d15ab6e..e48cf34 100644 --- a/src/main.lisp +++ b/src/main.lisp @@ -11,6 +11,7 @@ :login "name@example.com" :token "atlassian-token" :endpoint "example.atlassian.net" + :email-to "name@example.com" :jql "project = \"FAKE\" AND watcher != currentUser() AND key > \"FAKE-100\" ORDER BY created DESC"))) (run config))) @@ -41,9 +42,13 @@ total) ;; Watch each issue. - (loop for issue - across (gethash "issues" response) - do (watch-issue issue)) + ; (loop for issue + ; across (gethash "issues" response) + ; do (watch-issue config issue)) + (let ((issue (aref (gethash "issues" response) 0))) + (watch-issue config issue) + + (return)) ;; Stop looping if we're on the last page of results. (when (> start-at @@ -73,7 +78,9 @@ (:authorization . ,(format nil "Basic ~A" basic-auth-token)))))) -(defun watch-issue (issue) +(defun watch-issue (config issue) ;; 1. Watch issue in Jira ;; 2. Send email - (format t "Watching issue ~A~%" (gethash "key" issue))) + (format t "Watching issue ~A~%" (gethash "key" issue)) + + (deliver-email (email-to config) issue)) |
