mirror of
https://github.com/Threnklyn/jira.git
synced 2026-05-18 20:23:28 +02:00
[#66] add --started option to jira worklog add to change the start time for worklog
This commit is contained in:
@@ -449,12 +449,13 @@ const defaultWorklogTemplate = `{{/* worklog template */ -}}
|
||||
comment: |~
|
||||
{{ or .comment "" }}
|
||||
timeSpent: {{ or .timeSpent "" }}
|
||||
started:
|
||||
started: {{ or .started "" }}
|
||||
`
|
||||
|
||||
const defaultWorklogsTemplate = `{{/* worklogs template */ -}}
|
||||
{{ range .worklogs }}- # {{.author.name}}, {{.created | age}} ago
|
||||
comment: {{ or .comment "" }}
|
||||
started: {{ .started }}
|
||||
timeSpent: {{ .timeSpent }}
|
||||
|
||||
{{end}}`
|
||||
|
||||
@@ -42,6 +42,7 @@ func CmdWorklogAddUsage(cmd *kingpin.CmdClause, opts *WorklogAddOptions) error {
|
||||
cmd.Flag("noedit", "Disable opening the editor").SetValue(&opts.SkipEditing)
|
||||
cmd.Flag("comment", "Comment message for worklog").Short('m').StringVar(&opts.Comment)
|
||||
cmd.Flag("time-spent", "Time spent working on issue").Short('T').StringVar(&opts.TimeSpent)
|
||||
cmd.Flag("started", "Time you started work").Short('S').StringVar(&opts.Started)
|
||||
cmd.Arg("ISSUE", "issue id to fetch worklogs").Required().StringVar(&opts.Issue)
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -2,12 +2,7 @@
|
||||
eval "$(curl -q -s https://raw.githubusercontent.com/coryb/osht/master/osht.sh)"
|
||||
cd $(dirname $0)
|
||||
jira="../jira"
|
||||
export JIRA_LOG_FORMAT="%{level:-5s} %{message}"
|
||||
|
||||
ENDPOINT="http://localhost:8080"
|
||||
if [ -n "$JIRACLOUD" ]; then
|
||||
ENDPOINT="https://go-jira.atlassian.net"
|
||||
fi
|
||||
. env.sh
|
||||
|
||||
PLAN 8
|
||||
|
||||
@@ -31,7 +26,7 @@ EOF
|
||||
###############################################################################
|
||||
## Add a worklog to an issue
|
||||
###############################################################################
|
||||
RUNS $jira worklog add $issue --comment "work is hard" --time-spent "1h 12m" --noedit
|
||||
RUNS $jira worklog add $issue --comment "work is hard" --time-spent "1h 12m" -S "2017-01-29T09:17:00.000-0500" --noedit
|
||||
DIFF <<EOF
|
||||
OK $issue $ENDPOINT/browse/$issue
|
||||
EOF
|
||||
@@ -43,6 +38,7 @@ RUNS $jira worklog $issue
|
||||
DIFF <<EOF
|
||||
- # gojira, a minute ago
|
||||
comment: work is hard
|
||||
started: 2017-01-29T06:17:00.000-0800
|
||||
timeSpent: 1h 12m
|
||||
|
||||
EOF
|
||||
|
||||
Reference in New Issue
Block a user