mirror of
https://github.com/Threnklyn/jira.git
synced 2026-06-07 13:33:32 +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: |~
|
comment: |~
|
||||||
{{ or .comment "" }}
|
{{ or .comment "" }}
|
||||||
timeSpent: {{ or .timeSpent "" }}
|
timeSpent: {{ or .timeSpent "" }}
|
||||||
started:
|
started: {{ or .started "" }}
|
||||||
`
|
`
|
||||||
|
|
||||||
const defaultWorklogsTemplate = `{{/* worklogs template */ -}}
|
const defaultWorklogsTemplate = `{{/* worklogs template */ -}}
|
||||||
{{ range .worklogs }}- # {{.author.name}}, {{.created | age}} ago
|
{{ range .worklogs }}- # {{.author.name}}, {{.created | age}} ago
|
||||||
comment: {{ or .comment "" }}
|
comment: {{ or .comment "" }}
|
||||||
|
started: {{ .started }}
|
||||||
timeSpent: {{ .timeSpent }}
|
timeSpent: {{ .timeSpent }}
|
||||||
|
|
||||||
{{end}}`
|
{{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("noedit", "Disable opening the editor").SetValue(&opts.SkipEditing)
|
||||||
cmd.Flag("comment", "Comment message for worklog").Short('m').StringVar(&opts.Comment)
|
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("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)
|
cmd.Arg("ISSUE", "issue id to fetch worklogs").Required().StringVar(&opts.Issue)
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,12 +2,7 @@
|
|||||||
eval "$(curl -q -s https://raw.githubusercontent.com/coryb/osht/master/osht.sh)"
|
eval "$(curl -q -s https://raw.githubusercontent.com/coryb/osht/master/osht.sh)"
|
||||||
cd $(dirname $0)
|
cd $(dirname $0)
|
||||||
jira="../jira"
|
jira="../jira"
|
||||||
export JIRA_LOG_FORMAT="%{level:-5s} %{message}"
|
. env.sh
|
||||||
|
|
||||||
ENDPOINT="http://localhost:8080"
|
|
||||||
if [ -n "$JIRACLOUD" ]; then
|
|
||||||
ENDPOINT="https://go-jira.atlassian.net"
|
|
||||||
fi
|
|
||||||
|
|
||||||
PLAN 8
|
PLAN 8
|
||||||
|
|
||||||
@@ -31,7 +26,7 @@ EOF
|
|||||||
###############################################################################
|
###############################################################################
|
||||||
## Add a worklog to an issue
|
## 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
|
DIFF <<EOF
|
||||||
OK $issue $ENDPOINT/browse/$issue
|
OK $issue $ENDPOINT/browse/$issue
|
||||||
EOF
|
EOF
|
||||||
@@ -43,6 +38,7 @@ RUNS $jira worklog $issue
|
|||||||
DIFF <<EOF
|
DIFF <<EOF
|
||||||
- # gojira, a minute ago
|
- # gojira, a minute ago
|
||||||
comment: work is hard
|
comment: work is hard
|
||||||
|
started: 2017-01-29T06:17:00.000-0800
|
||||||
timeSpent: 1h 12m
|
timeSpent: 1h 12m
|
||||||
|
|
||||||
EOF
|
EOF
|
||||||
|
|||||||
Reference in New Issue
Block a user