summaryrefslogtreecommitdiff
path: root/rt-liberation.el
diff options
context:
space:
mode:
authorYoni Rabkin <yoni@rabkins.net>2020-08-03 18:54:17 -0400
committerYoni Rabkin <yoni@rabkins.net>2020-08-03 18:54:17 -0400
commit965be87719ab40ef57e8f37fda85c5851bd92e6f (patch)
tree94aa1c32bb5033894a8d73f238c77ece00a327d0 /rt-liberation.el
parent1995685feded34f0c70a8b6916fe593249602332 (diff)
fix broken dependencies
Diffstat (limited to 'rt-liberation.el')
-rw-r--r--rt-liberation.el36
1 files changed, 36 insertions, 0 deletions
diff --git a/rt-liberation.el b/rt-liberation.el
index aa48cea..ddd6900 100644
--- a/rt-liberation.el
+++ b/rt-liberation.el
@@ -396,6 +396,42 @@ AFTER date after predicate."
continue t))
ticketbase-list))
+(defun rt-liber-rest-ticketsql-runner-parser-f ()
+ "Parser function for a textual list of tickets."
+ (let (idsub-list)
+ (rt-liber-rest-parse-http-header)
+ (while (re-search-forward "ticket/\\([0-9].+\\)" (point-max) t)
+ (push (list (match-string-no-properties 1)
+ ".")
+ idsub-list))
+ idsub-list))
+
+(defun rt-liber-rest-run-ls-query (query)
+ "Run an \"ls\" type query against the server with QUERY."
+ (rt-liber-parse-answer
+ (rt-liber-rest-query-runner "ls" query)
+ 'rt-liber-rest-ticketsql-runner-parser-f))
+
+(defun rt-liber-rest-run-show-base-query (idsublist)
+ "Run \"show\" type query against the server with IDSUBLIST."
+ (rt-liber-parse-answer
+ (rt-liber-rest-show-query-runner idsublist)
+ #'rt-liber-ticket-base-retriever-parser-f))
+
+(defun rt-liber-rest-run-ticket-history-base-query (ticket-id)
+ "Run history query against server for TICKET-ID."
+ (rt-liber-parse-answer
+ (rt-liber-rest-query-runner "history" ticket-id)
+ #'(lambda ()
+ (rt-liber-rest-parse-http-header)
+ (buffer-substring (point) (point-max)))))
+
+(defun rt-liber-rest-command-set (id field status)
+ "Set ticket ID status to be STATUS."
+ (rt-liber-parse-answer
+ (rt-liber-rest-edit-runner id field status)
+ 'rt-liber-command-runner-parser-f))
+
;;; --------------------------------------------------------
;;; Ticket utilities