From ab1cd27c1dc11f110f452a7174f239b22354c0ee Mon Sep 17 00:00:00 2001 From: Cory Bennett Date: Sun, 21 Aug 2016 14:27:50 -0700 Subject: [PATCH] adding worklog related templates --- templates.go | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/templates.go b/templates.go index 44b64bc..af614b4 100644 --- a/templates.go +++ b/templates.go @@ -18,6 +18,8 @@ var allTemplates = map[string]string{ "comment": defaultCommentTemplate, "transition": defaultTransitionTemplate, "request": defaultDebugTemplate, + "worklog": defaultWorklogTemplate, + "worklogs": defaultWorklogsTemplate, } const defaultDebugTemplate = "{{ . | toJson}}\n" @@ -150,3 +152,17 @@ transition: id: {{ .transition.id }} name: {{ .transition.name }} ` + +const defaultWorklogTemplate = `# issue: {{ .issue }} +comment: |~ + {{ or .comment "" }} +timeSpent: {{ or .timeSpent "" }} +started: +` + +const defaultWorklogsTemplate = `{{ range .worklogs }}- # {{.author.name}}, {{.created | age}} ago + comment: {{ or .comment "" }} + timeSpent: {{ .timeSpent }} + +{{end}} +`