diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/main.lisp | 24 | 
1 files changed, 20 insertions, 4 deletions
| diff --git a/src/main.lisp b/src/main.lisp index ecf0ed3..0706a33 100644 --- a/src/main.lisp +++ b/src/main.lisp @@ -22,10 +22,22 @@                                      (login config)                                      (token config))))) -    (fetch-issues -      (endpoint config) -      (jql config) -      :basic-auth-token basic-auth-token))) +    (loop +      (let* ((response (fetch-issues +                         (endpoint config) +                         (jql config) +                         :basic-auth-token basic-auth-token)) + +             (start-at (gethash "startAt" response)) +             (max-results (gethash "maxResults" response)) +             (total (gethash "total" response))) + +        (watch-issues (gethash "issues" response)) + +        ;; Stop looping if we're on the last page of results. +        (when (> start-at +                 (- total max-results)) +          (return))))))  (defun fetch-issues (endpoint jql &key basic-auth-token)    (jzon:parse @@ -37,3 +49,7 @@                :headers `((:content-type . "application/json")                           (:authorization                            . ,(format nil "Basic ~A" basic-auth-token)))))) + +(defun watch-issues (issues) +  (loop for issue across issues do +    (format t "Watching issue ~A~%" (gethash "key" issue)))) | 
