diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/main.lisp | 26 | 
1 files changed, 18 insertions, 8 deletions
| diff --git a/src/main.lisp b/src/main.lisp index 4c1c498..7f6973f 100644 --- a/src/main.lisp +++ b/src/main.lisp @@ -7,11 +7,21 @@    ;; Send email to ^maildir^program^ containing message with issue metadata    ;; Continue to next page -  (dex:post "https://example.atlassian.net/rest/api/3/search" -            :content -            "{ -            \"jql\": \"project = \\\"FAKE\\\" AND watcher != currentUser() AND key > \\\"FAKE-100\\\" ORDER BY created DESC\", -            \"fields\": [\"id\", \"key\", \"self\"] -            }" -            :headers '((:content-type . "application/json") -                       (:authorization . "Basic TOKEN")))) +  (fetch-issues +    "project = \\\"FAKE\\\" AND watcher != currentUser() AND key > \\\"FAKE-100\\\" ORDER BY created DESC" +    :basic-auth-token "TOKEN")) + +(defun fetch-issues (jql &key basic-auth-token) +  (multiple-value-bind (body code) +    (dex:post "https://example.atlassian.net/rest/api/3/search" +              :content +              (format nil "{ +                      \"jql\": \"~A\", +                      \"fields\": [\"id\", \"key\", \"self\"] +                      }" +                      jql) +              :headers `((:content-type . "application/json") +                         (:authorization +                          . ,(format nil "Basic ~A" basic-auth-token)))) + +    body)) | 
