Compare commits

...

135 Commits

Author SHA1 Message Date
coryb 748b7d552f Merge pull request #512 from go-jira/v3-api-search
update for v3 search api
2025-11-11 11:18:26 -08:00
Cory Bennett bf988a00b4 update for v3 search api 2025-11-11 11:08:53 -08:00
Judson Lester f50f3d2b16 Merge pull request #398 from nenad/patch/load-config-browse
Load config on "jira browse"
2025-05-07 11:44:51 -07:00
Ron Green 4263bd24f9 Merge pull request #450 from georgettica/georgettica/add-summary
feat(create): allow setting summary
2022-10-27 10:03:49 +03:00
Judson Lester f922fc7fb7 Merge pull request #440 from makkes/default-col-width
feat: add `defaultColWidth` template function
2022-10-26 17:28:42 -07:00
Judson Lester a5358286b2 Merge pull request #416 from samsm/patch-1
Update (miscopied?) description of rank command
2022-10-26 17:28:16 -07:00
Judson Lester e3f29d4884 Merge pull request #395 from seanblong/bug/remove-login-loop
Remove (possible) infinite loop from CmdLogin.
2022-10-13 10:11:48 -07:00
Ron Green 10ad221ce4 attempt to make tests pass 2021-12-05 18:00:31 +02:00
Ron Green 6e90b2000a feat(create): allow setting summary
shamelessly taken from his fork

a part of me going through all of the forks and pulling all of the
useful info out

Co-authored-by: Ben Cordero <bencord0@condi.me>
2021-12-05 17:56:12 +02:00
Mike Pountney 07bd89afca Merge pull request #447 from catskul/fix-rvl-auth-bearer-token
Fix rvl auth bearer token branch
2021-11-27 17:09:03 -08:00
Andrew Somerville b3723c7b63 wrap token comparisons in a function, proliferate it virtually everywhere apk-token was, and fix some related tab/space issues 2021-11-21 01:21:26 -05:00
Max Jonas Werner 80adab38ee feat: add defaultColWidth template function
This function can be used in templates to change the default column
width to accommodate wider terminals.
2021-08-09 13:15:32 +02:00
Rodney Lorrimar ccb5fadfc3 Add documentation for bearer token authentication 2021-08-03 13:18:36 +08:00
Rodney Lorrimar fedc66614f Add authentication-method: bearer-token 2021-08-03 13:02:38 +08:00
Ron Green a59fdc81fc feat(OWNERS): make myself a code owner 2021-05-27 09:10:23 -04:00
Ron Green 892bedc8a2 fix(actions): fix release.yml
this is a WIP and should solve the promotion problem
2021-05-18 09:55:03 -04:00
ldelossa 29b5dda228 chore: v1.0.28 changelog bump 2021-05-05 10:18:27 -04:00
Ron Green f16109e038 Update prepare-release.yml 2021-05-05 10:15:09 -04:00
Ron Green f089cd51f2 go fmt all tree 2021-05-05 08:40:24 -04:00
mlerman 70e91a94b5 Update cli.go
adding option --file for create command
2021-05-05 08:40:24 -04:00
Ron Green 298a637f8c fix rebase issue 2021-05-05 08:40:24 -04:00
Sam Schenkman-Moore 7f1a21fd5c Update (miscopied?) description of command
This looked like an artifact of a copy/paste sorta situation: the current description for the `rank` command has the description for the `block` command.

I ad libbed a new description that is hopefully at least _more_ correct 😄
2021-04-10 11:05:48 -04:00
Nenad Stojanovikj c32908a6ff Load config on "jira browse"
This is done in order to ensure consistency with the other commands on how the configuration files are loaded. I found out about it when I had set up a global project, but the "jira browse 1234" command complained about missing project.
2020-11-30 15:02:48 +01:00
seanblong 1c55c069d3 Remove (possible) infinite loop from CmdLogin. 2020-11-16 19:59:13 -08:00
ldelossa 2c7a9b2830 chore: V1.0.27 changelog bump 2020-10-07 16:09:58 -04:00
Evan Gates f7587f43f1 block: reverse order of arguments
The BLOCKER and ISSUE arguments for the block command were incorrect.
With hypothetical ticket names BLOCKER and ISSUE, calling

	jira block BLOCKER ISSUE

resulted in

	ISSUE blocks BLOCKER
	BLOCKER is blocked by ISSUE

which is the reverse of the documentation which claims it should be

	BLOCKER blocks ISSUE
	ISSUE is blocked by BLOCKER

Reverse order of the arguments so the documentation matches the
actual usage.  This does not break existing usage, only updates the
documentation.

Fixes #383
2020-10-01 13:48:18 -04:00
Evan Gates 0e3082fab6 templates: add wrap helper function
Add "wrap" command to TemplateProcessor.  Use
github.com/mitchellh/go-wordwrap to wrap lines on word breaks at
a given length.  This can make long fields much more readable in
a terminal.  E.g.

	{{ .fields.description | wrap 76 | indent 2}}
2020-09-30 11:51:06 -04:00
Keien Ohta 6fbc522ee7 also use login for subtask 2020-09-15 13:31:17 -04:00
Keien Ohta c2abbd9864 update templates with emailAddress and login
go-jira/jira#369
2020-09-15 13:31:17 -04:00
ldelossa c3d22b765a chore: v1.0.26 changelog bump 2020-09-11 14:12:24 -04:00
ldelossa 96ec3339a4 cicd: automated releases fixes
Signed-off-by: ldelossa <ldelossa@redhat.com>
2020-09-11 14:04:47 -04:00
ldelossa 31f7b03978 cicd: automated changelog and release
Signed-off-by: ldelossa <ldelossa@redhat.com>
2020-09-11 10:50:22 -04:00
ldelossa 578c44c628 chore: v1.0.25 release
Signed-off-by: ldelossa <ldelossa@redhat.com>
2020-09-11 09:31:35 -04:00
ldelossa aa8dae7c5b bugfix: only build jira tool with gox
previosly running the "make all" target build th schema binary with the
same name as the jira binaries. This caused the schema tool to be called
incorrectly. Gox performing parallel builds made this issue only happen
"somtimes".

Signed-off-by: ldelossa <ldelossa@redhat.com>
2020-09-11 09:15:07 -04:00
ldelossa a8c961fe19 tests: rework passive tests into native go tests
this commit re-works the basic.t tests and administers them using go's
native testing suite.

Signed-off-by: ldelossa <ldelossa@redhat.com>
2020-09-11 09:15:07 -04:00
Alan Voiski 42e5d23f63 Ensure body is NPE safe 2020-09-07 16:24:45 -04:00
Alan Voiski b572037cfe Support empty responses in request commands
Avoid JSON parser when the response is empty - common cases for HTTP 204 in issues deletion, or moving issues to sprint.
2020-09-07 16:24:45 -04:00
ldelossa ff5decc114 fix(changelog): fix changelog version 2020-09-04 15:58:38 -04:00
ldelossa 1d27af0a2c Updated Changelog 2020-09-04 14:30:24 -04:00
Dan Loewenherz 7179f36e5f ensure GO111MODULE is set to on prior to installing
This closes #291.
2020-09-04 14:21:49 -04:00
coryb a1450e879f Merge pull request #367 from bbkane/master
Make -h flag show --help
2020-08-31 16:30:07 -07:00
Cory Bennett 7da5f353ac add @ldelossa to list of default reviewers 2020-08-31 16:26:57 -07:00
Cory Bennett 18e2c1d5b7 version bump 2020-08-31 16:23:50 -07:00
Cory Bennett c6ef367e89 Updated Changelog 2020-08-31 16:23:50 -07:00
Benjamin Kane 4bf1d030e7 Make -h flag show --help 2020-08-31 16:12:42 -07:00
ldelossa d093bcf63a cicd: deflake tests
this commit removes the parallel test matrix as parallel testing runs
the potention of trampling one another

Signed-off-by: ldelossa <ldelossa@redhat.com>
2020-08-31 13:26:57 -04:00
ldelossa 3bc5e42bd0 tests: transition if under review
this commit attempts to transition any failed test issues if they ticket
is left in "Under Review" state

Signed-off-by: ldelossa <ldelossa@redhat.com>
2020-08-31 12:55:19 -04:00
ldelossa 3c1c4d95e1 transition: map field name to id
this commit allows a user to use the more friendly field.Name when
transitioning to states which require custom field inputs.

Signed-off-by: ldelossa <ldelossa@redhat.com>
2020-08-28 22:06:46 -04:00
ldelossa 6a27e28c61 username-deprecation: use email and display names
this commit deprecates the searching ability by username and
instructs user to provide email or display names in commands.

the username parameter has been deprecated completely from v2 and v3
api

Signed-off-by: ldelossa <ldelossa@redhat.com>
2020-08-28 17:59:14 -04:00
coryb 36e2a914cd Merge pull request #349 from aszenz/patch-1
Fix command for sprint issues w/o project
2020-06-18 09:40:59 -07:00
coryb 97591ef200 Merge pull request #355 from go-jira/vanniktech-patch-1
Remove myself as a code owner
2020-06-18 09:21:40 -07:00
Niklas Baudy 5c93c4e8d7 Remove myself as a code owner
Frankly, I've stopped using this since I went from being employed to freelance and only a few of my clients are using Jira.
2020-06-18 11:38:56 +02:00
asrar a9dd1ed310 Fix command for sprint issues w/o project
Instead of echo error message, show all sprint issues
2020-06-12 12:01:36 +05:30
coryb af7a8f45e4 Merge pull request #323 from tjamet/issue-comment
Add support to get all comments for an issue
2020-03-24 12:10:26 -07:00
Thibault Jamet a311d0d817 Add support to get all comments for an issue 2020-03-24 14:44:55 +01:00
coryb 01c0c38d8c Merge pull request #318 from jrschumacher/patch-1
Update README for simpler instructions for Atlassian Cloud users
2020-02-26 10:04:38 -08:00
coryb 417568ca2d Merge pull request #317 from go-jira/privacy-migration
update all usage of user.name to user.accountId for privacy migration
2020-02-26 10:02:23 -08:00
Ryan Schumacher fae004391a Update authentication for more clarity 2020-02-25 16:06:58 -08:00
Cory Bennett a26683e01d update all usage of user.name to user.accountId for privacy migration:
https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/
2020-02-23 23:59:39 -08:00
Mike Pountney 57e1c7426e Merge pull request #302 from go-jira/simplify-template-tables
add template functions to handle table output, fixes #176, replaces #296
2019-12-02 18:19:10 -08:00
Cory Bennett 7e9746304a add template functions to handle table output, fixes #176, replaces #296 2019-12-02 14:43:07 -08:00
coryb 7cd34d3698 Merge pull request #292 from pdecat/cache_password
Cache password to avoid invoking password source on each API request with api-token
2019-12-01 20:58:02 -08:00
coryb f5871c5a58 Merge branch 'master' into cache_password 2019-12-01 20:41:49 -08:00
Cory Bennett 01bdea9778 Merge branch 'patrickpichler-make-password-source-binary-exchangeable' 2019-12-01 20:30:11 -08:00
Cory Bennett d6173ce77d use password-source-path to allow overriding binary and/or path to binary 2019-12-01 20:27:00 -08:00
Cory Bennett e26fbfcb14 Merge branch 'make-password-source-binary-exchangeable' of https://github.com/patrickpichler/jira into patrickpichler-make-password-source-binary-exchangeable 2019-12-01 20:16:40 -08:00
coryb b590005aac Merge pull request #301 from go-jira/allow-issue-ints
allow issues on command line to automatically prefix with project when defined
2019-12-01 17:27:59 -08:00
Cory Bennett d002d7fe74 allow issues on command line to automatically prefix with project when defined 2019-12-01 16:29:35 -08:00
colton riffel 789886c68e Forgot you use TAB instead of spaces 2019-12-01 16:21:52 -08:00
colton riffel 8a462152ea Fixed append project to view 2019-12-01 16:21:52 -08:00
colton riffel 9cbd9937be Added a line break removal function 2019-12-01 16:21:52 -08:00
colton riffel db53622548 Pushed Readfile to .jira.d directory instead of pwd 2019-12-01 16:21:52 -08:00
Patrick Decat 0f059a5ed1 Cache password to avoid invoking password source on each API request 2019-11-02 09:46:50 +01:00
Patrick Pichler 659a5c8e74 Add support to switch out password source binary
There is now a new configuration entry option `password-source-binary`,
which allows to use an alternate binary for the gopass/pass password
source.

If the option is not specified, we will fallback to `pass` (for `pass`)
and `gopass` (for `gopass`).
2019-10-21 10:49:38 +02:00
coryb 590244947b Merge pull request #286 from patrickpichler/add-gopass-instructions-to-readme
Add gopass section to README.md
2019-10-04 08:52:05 -07:00
Patrick Pichler 6e87b646ff Add gopass section to README.md 2019-10-04 10:06:02 +02:00
Mike Pountney b045cd74c2 Merge pull request #285 from patrickpichler/add-gopass-support
Add gopass as password source support
2019-10-03 17:04:31 -07:00
Patrick Pichler 3339303e89 Add error handling to pass password-source 2019-10-03 13:43:56 +02:00
Patrick Pichler 3c0a62e74f Add gopass support 2019-10-03 13:24:32 +02:00
coryb 967602392f fix travis build badge 2019-10-02 11:00:02 -07:00
coryb 568f0be821 Merge pull request #283 from go-jira/sprig
add sprig template functions, replaces [#215]
2019-10-02 10:53:09 -07:00
Cory Bennett 719f7a68a7 add sprig template functions, replaces [#215]
http://masterminds.github.io/sprig/
2019-10-02 08:24:04 -07:00
Cory Bennett 979910f8dd Merge branch 'arenstar-feature/projectversion' 2019-10-01 23:50:19 -07:00
Cory Bennett 90f01ce60a [#232] fix api to use common Version schema
also rewrote the schema fetcher to use Go
2019-10-01 23:40:33 -07:00
Cory Bennett 2c9d957304 version bump 2019-10-01 21:33:10 -07:00
Cory Bennett 4445255914 Updated Changelog 2019-10-01 21:33:10 -07:00
Cory Bennett a13b046fad fix syntax 2019-10-01 21:33:10 -07:00
Adriano 997b6e1f24 Add 'pctOf' and 'fit' template functions 2019-10-01 21:33:10 -07:00
Patrick Cockwell 8ede63c37e Address comments for direct name match 2019-10-01 21:33:10 -07:00
Patrick Cockwell 62ccffaf05 Choose exact transition match if available 2019-10-01 21:33:10 -07:00
Mike Pountney 2062dffc60 fix _t/test_binaries.sh to work on Linux + MacOS 2019-10-01 21:33:10 -07:00
Mike Pountney 435747f152 Ensure travis makes and tests binaries 2019-10-01 21:33:10 -07:00
Mike Pountney d343852592 Update from xgo to gox; add basic test for binaries 2019-10-01 21:33:10 -07:00
Mike Pountney 22c72f2351 version bump 2019-10-01 21:33:10 -07:00
Mike Pountney a057957086 Updated Changelog 2019-10-01 21:33:10 -07:00
Mike Pountney 3333859bf0 Updated Changelog 2019-10-01 21:33:10 -07:00
Cory Bennett 8b56ee9fb9 update to more actively supported xgo for module support 2019-10-01 21:33:10 -07:00
Mike Pountney a467a5c5e5 Add 1.13.x build test to travis 2019-10-01 21:33:10 -07:00
Cory Bennett 0d7d4dc4b8 [#277] update figtree to latest 2019-10-01 21:33:10 -07:00
Mike Pountney ba7cc13145 Switch over to using github.com/go-jira/jira, from gopkg.in
There should be no reason to use gopkg.in versioned imports now that
we're using go modules. I think, IANAE.

gopkg.in kind of gets in the way of modules, as it only pulls over
tagged releases from github.com -- this then means that you need to use
go modules 'replace' syntax in the go.mod to use a non-versioned commit
or branch. This is feasible, but kind of ugly.

go modules defaults to pulling the latest version, so the default
behavior is the same as when pulling go-jira.v1 from gopkg.in.
2019-10-01 21:29:46 -07:00
Mike Pountney 3984d0d484 Fixes #228: make ':' gpg files temporary to fix go mod 2019-10-01 21:29:45 -07:00
Matthias Bethke 0037a21a95 fix worklog template to allow multiline comments 2019-10-01 21:29:45 -07:00
Justin Ko b99dfbfbf6 Allow reading password from stdin
Allow reading password from stdin in `jira login`. This is useful for
combining the jira tool with other command-line utilities.
2019-10-01 21:29:45 -07:00
Cory Bennett 8e4245e5bb add CODEOWNERS file 2019-10-01 21:29:45 -07:00
Daniel Martí bb9790f287 all: unindent some code 2019-10-01 21:29:45 -07:00
Daniel Martí 17003717d9 don't use ReadAll when decoding JSON
An empty stream isn't valid JSON, so we shouldn't silently ignore it.
2019-10-01 21:29:45 -07:00
Daniel Martí dc9a9de165 README: trim down the content
This README is huge; the document shouldn't take more than two or three
screens. If we need more docs, they should be linked to and live
elsewhere.

For now, start by removing unnecessary sections. Gitter has been
completely unused since 2017, so remove it. The table of contents also
takes a lot of vertical space, when we don't want to have that much
content to begin with.

Tips on forking are also unnecessary, since that's the same for all Go
projects. Moreover, this is out of date now that the project is a Go
module.

Remove the help output, as that can be obtained extremely easily by just
running 'jira -h'.

Finally, remove the v0-v1 changes, as v0 was last released over three
years ago. It's extremely unlikely that anyone still has to upgrade from
the older version.
2019-10-01 21:29:45 -07:00
Daniel Martí 30998cbb18 start making staticcheck happier 2019-10-01 21:29:45 -07:00
Daniel Martí 89fe2ecf16 all: convert to a Go module
And remove vendor/, as it's now unnecessary. go.sum ensures that
dependencies aren't tampered with, and proxy.golang.org keeps copies of
all the archives.
2019-10-01 21:29:45 -07:00
Daniel Martí 8994b42f71 t: rename to _t to fix module support
The following two files contain characters which aren't valid in source
files within a Go module:

	t/.password-store/GoJira/api-token:gojira@corybennett.org.gpg
	t/.password-store/GoJira/api-token:mothra@corybennett.org.gpg

The directory only contains test scripts, so it doesn't need to be
included in the module. The simplest way to do that is to start the
directory with an underscore.

Fixes #228.
2019-10-01 21:29:45 -07:00
Daniel Martí 80743e4da8 CI: test on Go 1.12.x, cleanup
We can also use the apt addon to install packages. We also don't need
fast_finish, since we don't use allow_failures anywhere.

Finally, the 'go get' line was pointless, as all dependencies are
vendored, and 'go test' will catch build failures.
2019-10-01 21:29:45 -07:00
Cory Bennett 9f46c8499d make automatic pagination on search optional, fix tests 2019-10-01 21:29:45 -07:00
Julien Graglia bca064be1f API Token auth requires "user" config
API Token authentication requires the `user ` to be defined in the config
2019-10-01 21:29:45 -07:00
Julian Swagemakers 48c15e2daa docs: update pass documentation with password-name
This will update the README.md to include setting the configuration
option password-name when using pass.
2019-10-01 21:29:45 -07:00
CodeLingo Bot 3cf2e56e1f Fix function comments based on best practices from Effective Go
Signed-off-by: CodeLingo Bot <bot@codelingo.io>
2019-10-01 21:29:45 -07:00
Cory Bennett c270f20d21 add test for --limit 2019-10-01 21:29:45 -07:00
Cory Bennett a6bf26052c prefer defer resp.Body.Close to avoid leaks on subsequent errors 2019-10-01 21:29:45 -07:00
Cory Bennett 954a97eca3 version bump 2019-10-01 21:29:45 -07:00
Cory Bennett dd6901b2cd Updated Changelog 2019-10-01 21:29:45 -07:00
Miles Maddox 9186205b9e add pagination to search 2019-10-01 21:29:45 -07:00
Cory Bennett 78c66dba6f version bump 2019-10-01 21:20:00 -07:00
Cory Bennett 87112c0f98 Updated Changelog 2019-10-01 21:20:00 -07:00
Cory Bennett 94dd489a10 fix syntax 2019-10-01 21:20:00 -07:00
coryb 050a2b4819 Merge pull request #273 from acaloiaro/master
Add 'pctOf' and 'fit' template functions
2019-10-01 21:15:20 -07:00
coryb d3b3c03f90 Merge pull request #282 from pcockwell/fix/choose-direct-transition-match-if-available
Choose exact transition match if available
2019-09-30 17:06:30 -07:00
Patrick Cockwell a70384b03b Address comments for direct name match 2019-09-30 16:57:14 -07:00
Patrick Cockwell a646f76b1f Choose exact transition match if available 2019-09-30 16:41:44 -07:00
Mike Pountney 9bb0ff379d Merge pull request #280 from go-jira/cut_v1_0_21
Cut v1.0.21 onto master; make binaries with gox not xgo, and test them.
2019-09-28 23:50:13 -07:00
Mike Pountney 0726101762 fix _t/test_binaries.sh to work on Linux + MacOS 2019-09-17 22:27:28 -07:00
Mike Pountney 2d13725ccf Ensure travis makes and tests binaries 2019-09-17 22:19:37 -07:00
Mike Pountney 490a47db43 Merge branch 'use_gox_not_xgo' into cut_v1_0_21 2019-09-17 21:55:24 -07:00
Mike Pountney 396ae5fb6a Update from xgo to gox; add basic test for binaries 2019-09-17 21:48:59 -07:00
Adriano 027adeef46 Add 'pctOf' and 'fit' template functions 2019-08-25 15:20:48 -04:00
David Arena 410df68354 Returning upstream 2019-02-05 17:21:51 +01:00
David Arena aaa72012a7 Adding ProjectVersion 2019-02-04 18:36:11 +01:00
78 changed files with 4187 additions and 768 deletions
+60
View File
@@ -0,0 +1,60 @@
{{ if .Versions -}}
<a name="unreleased"></a>
## [Unreleased]
{{ if .Unreleased.CommitGroups -}}
{{ range .Unreleased.CommitGroups -}}
### {{ .Title }}
{{ range .Commits -}}
- [{{.Hash.Short}}]({{ $.Info.RepositoryURL }}/commit/{{ .Hash.Long }}): {{ .Subject }}
{{ if .Refs -}}{{ range .Refs }} -{{if .Action}}{{ .Action }} {{ end }} [#{{ .Ref }}]({{ $.Info.RepositoryURL }}/issues/{{ .Ref }}){{ end -}}
{{ end -}}
{{ end -}}
{{ end -}}
{{ end -}}
{{ range .Versions }}
<a name="{{ .Tag.Name }}"></a>
## {{ if .Tag.Previous }}[{{ .Tag.Name }}]{{ else }}{{ .Tag.Name }}{{ end }} - {{ datetime "2006-01-02" .Tag.Date }}
{{ range .CommitGroups -}}
### {{ .Title }}
{{ range .Commits -}}
- [{{.Hash.Short}}]({{ $.Info.RepositoryURL }}/commit/{{ .Hash.Long }}): {{ .Subject }}
{{ if .Refs -}}{{ range .Refs }} - {{if .Action}}{{ .Action }}{{ end }} [#{{ .Ref }}]({{ $.Info.RepositoryURL }}/issues/{{ .Ref }}){{ end -}}
{{ end -}}
{{ end -}}
{{ end -}}
{{- if .RevertCommits -}}
### Reverts
{{ range .RevertCommits -}}
- {{ .Revert.Header }}
{{ end }}
{{ end -}}
{{- if .MergeCommits -}}
### Pull Requests
{{ range .MergeCommits -}}
- {{ .Header }}
{{ end }}
{{ end -}}
{{- if .NoteGroups -}}
{{ range .NoteGroups -}}
### {{ .Title }}
{{ range .Notes }}
{{ .Body }}
{{ end }}
{{ end -}}
{{ end -}}
{{ end -}}
{{- if .Versions }}
[Unreleased]: {{ .Info.RepositoryURL }}/compare/{{ $latest := index .Versions 0 }}{{ $latest.Tag.Name }}...HEAD
{{ range .Versions -}}
{{ if .Tag.Previous -}}
[{{ .Tag.Name }}]: {{ $.Info.RepositoryURL }}/compare/{{ .Tag.Previous.Name }}...{{ .Tag.Name }}
{{ end -}}
{{ end -}}
{{ end -}}
{{ end -}}
+29
View File
@@ -0,0 +1,29 @@
style: github
template: CHANGELOG.tpl.md
info:
title: CHANGELOG
repository_url: https://github.com/go-jira/go-jira
options:
commits:
sort_by: Scope
commit_groups:
group_by: Scope
header:
pattern: '^(.*):\s*(.*)$'
pattern_maps:
- Scope
- Subject
issues:
prefix:
- "#"
refs:
actions:
- Closes
- Fixes
- PullRequest
notes:
keywords:
- BREAKING CHANGE
- NOTE
+1 -1
View File
@@ -1,2 +1,2 @@
# one of these users must approve the PR before merging
* @coryb @mvdan @vanniktech @mikepea
* @coryb @mikepea @ldelossa @georgettica
+23
View File
@@ -0,0 +1,23 @@
---
name: CI
on: [push, pull_request]
jobs:
tests:
name: Tests
runs-on: ubuntu-latest
container: docker.io/library/golang:${{ matrix.go }}
strategy:
matrix:
go: ['1.13', '1.14']
steps:
- name: Checkout
uses: actions/checkout@v2
- name: add gox
run: go install github.com/mitchellh/gox
- name: make binaries
run: make all
- name: perform tests
run: go test -v ./...
+40
View File
@@ -0,0 +1,40 @@
---
name: Prepare Release
on:
workflow_dispatch:
inputs:
branch:
description: 'the branch to prepare the release against'
required: true
deault: 'master'
tag:
description: 'the tag to be released'
required: true
jobs:
prepare:
name: Prepare Release
runs-on: 'ubuntu-latest'
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
ref: ${{ github.event.inputs.branch }}
- name: Changelog
shell: bash
run: |
curl -L -o /tmp/git-chglog.tar.gz https://github.com/git-chglog/git-chglog/releases/download/v0.14.2/git-chglog_0.14.2_linux_amd64.tar.gz
tar xf /tmp/git-chglog.tar.gz -C /tmp git-chglog
chmod u+x /tmp/git-chglog
echo "creating change log for tag: ${{ github.event.inputs.tag }}"
/tmp/git-chglog --next-tag "${{ github.event.inputs.tag }}" -o CHANGELOG.md
- name: Create Pull Request
uses: peter-evans/create-pull-request@v3.8.2
with:
title: "${{ github.event.inputs.tag }} Changelog Bump"
body: "This is an automated changelog commit."
commit-message: "chore: ${{ github.event.inputs.tag }} changelog bump"
branch: "ready-${{ github.event.inputs.tag }}"
signoff: "gh-actions"
+103
View File
@@ -0,0 +1,103 @@
---
name: Release
on:
push:
tags:
- v1.*
jobs:
release:
name: Release
runs-on: 'ubuntu-latest'
container: docker.io/library/golang:1.14
steps:
# This step is for local testing using https://github.com/nektos/act
- name: install node
run: |
apt update
apt install -y nodejs
- name: Setup
run: |
tag=`basename ${{ github.ref }}`
echo "VERSION=${tag}" >> $GITHUB_ENV
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: add gox
run: go install github.com/mitchellh/gox
- name: ChangeLog
shell: bash
run: |
curl -o git-chglog -L https://github.com/git-chglog/git-chglog/releases/download/0.9.1/git-chglog_linux_amd64
chmod u+x git-chglog
tag=`basename ${{ github.ref }}`
echo "creating change log for tag: $tag"
chglog="$(./git-chglog ${tag})"
chglog="${chglog//'%'/'%25'}"
chglog="${chglog//$'\n'/'%0A'}"
chglog="${chglog//$'\r'/'%0D'}"
echo "CHANGELOG=${chglog}" >> $GITHUB_ENV
- name: Create Release
id: create_release
uses: actions/create-release@latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: ${{ env.VERSION }} Release
body: |
${{ env.CHANGELOG }}
prerelease: ${{ contains(env.VERSION, 'alpha') || contains(env.VERSION, 'beta') || contains(env.VERSION, 'rc') }}
# perform production release of artifacts
- name: Build Artifacts
run: |
VERSION=${{ env.VERSION }} make all
- name: "Publish Darwin AMD64"
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./dist/github.com/go-jira/jira-darwin-amd64
asset_name: jira-darwin-amd64
asset_content_type: application/octet-stream
- name: "Publish Linux 386"
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./dist/github.com/go-jira/jira-linux-386
asset_name: jira-linux-386
asset_content_type: application/octet-stream
- name: "Publish Linux AMD64"
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./dist/github.com/go-jira/jira-linux-amd64
asset_name: jira-linux-amd64
asset_content_type: application/octet-stream
- name: "Publish Windows 386"
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./dist/github.com/go-jira/jira-windows-386.exe
asset_name: jira-windows-386.exe
asset_content_type: application/octet-stream
- name: "Publish Windows AMD64"
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./dist/github.com/go-jira/jira-windows-amd64.exe
asset_name: jira-windows-amd64.exe
asset_content_type: application/octet-stream
-20
View File
@@ -1,20 +0,0 @@
addons:
apt:
packages:
- pass
- gnupg
language: go
go:
- 1.12.x
- 1.13.x
env:
- GO111MODULE=on
script:
- go test ./...
- go vet -composites=false ./...
- make
- make prove 2>&1
+451 -364
View File
@@ -1,426 +1,513 @@
# Changelog
<a name="unreleased"></a>
## [Unreleased]
<a name="v1.0.28"></a>
## [v1.0.28] - 2021-05-05
<a name="v1.0.27"></a>
## [v1.0.27] - 2020-10-01
### Block
- [f7587f4](https://github.com/go-jira/go-jira/commit/f7587f43f12bcf0b47e52a5abe775daf6cbb3229): reverse order of arguments
### Chore
- [2c7a9b2](https://github.com/go-jira/go-jira/commit/2c7a9b283025202428db629b1a9ecdc63a9b704f): V1.0.27 changelog bump
### Templates
- [0e3082f](https://github.com/go-jira/go-jira/commit/0e3082fab6e12a337f5fe26c3e2dec5cb51425d8): add wrap helper function
<a name="v1.0.26"></a>
## [v1.0.26] - 2020-09-11
### Chore
- [c3d22b7](https://github.com/go-jira/go-jira/commit/c3d22b765a6f3cd93445033da5c19fc0feaeaece): v1.0.26 changelog bump
### Cicd
- [96ec333](https://github.com/go-jira/go-jira/commit/96ec3339a4cc810da20450a9d9e91612c2b9aad4): automated releases fixes
- [31f7b03](https://github.com/go-jira/go-jira/commit/31f7b0397890388947f2312cf42af494c7a6979f): automated changelog and release
<a name="v1.0.25"></a>
## [v1.0.25] - 2020-09-11
### Bugfix
- [aa8dae7](https://github.com/go-jira/go-jira/commit/aa8dae7c5b7035e086bd60b3d354ffa43c30caf7): only build jira tool with gox
### Chore
- [578c44c](https://github.com/go-jira/go-jira/commit/578c44c628e3134e4d46f3250baf46d6b054cfe8): v1.0.25 release
### Fix(Changelog)
- [ff5decc](https://github.com/go-jira/go-jira/commit/ff5decc114b297e9b393f8d4af72bbace0037c73): fix changelog version
### Tests
- [a8c961f](https://github.com/go-jira/go-jira/commit/a8c961fe19f424df3fdbe108a374cc56b8ff9fe0): rework passive tests into native go tests
<a name="v1.0.24"></a>
## [v1.0.24] - 2020-09-04
### Cicd
- [d093bcf](https://github.com/go-jira/go-jira/commit/d093bcf63adbd1d4e88640307aa8a5c8669ac535): deflake tests
### Tests
- [3bc5e42](https://github.com/go-jira/go-jira/commit/3bc5e42bd0186dbc5c47f022b9528207140fa297): transition if under review
### Transition
- [3c1c4d9](https://github.com/go-jira/go-jira/commit/3c1c4d95e199a717499f1f4259649152a6832e9f): map field name to id
### Username-Deprecation
- [6a27e28](https://github.com/go-jira/go-jira/commit/6a27e28c61c45f4b2a6aff473cf28852a2df64a2): use email and display names
### Pull Requests
- Merge pull request [#367](https://github.com/go-jira/go-jira/issues/367) from bbkane/master
- Merge pull request [#349](https://github.com/go-jira/go-jira/issues/349) from aszenz/patch-1
- Merge pull request [#355](https://github.com/go-jira/go-jira/issues/355) from go-jira/vanniktech-patch-1
- Merge pull request [#323](https://github.com/go-jira/go-jira/issues/323) from tjamet/issue-comment
<a name="v1.0.23"></a>
## [v1.0.23] - 2020-02-26
### Add Sprig Template Functions, Replaces [#215] Http
- [719f7a6](https://github.com/go-jira/go-jira/commit/719f7a68a7f2c01e428a1ad3519a611c92268d27): //masterminds.github.io/sprig/
- [#215](https://github.com/go-jira/go-jira/issues/215)### All
- [31c113d](https://github.com/go-jira/go-jira/commit/31c113d1baf2dba814bca3e1dcc519ab8b0269e9): unindent some code
- [f125ef3](https://github.com/go-jira/go-jira/commit/f125ef3fa9c7a64e8dfda9a643cadf0241b09bc7): convert to a Go module
### CI
- [664c5ca](https://github.com/go-jira/go-jira/commit/664c5cad246cbd4c861b615eb567d3874151d1a1): test on Go 1.12.x, cleanup
### Docs
- [d8189f0](https://github.com/go-jira/go-jira/commit/d8189f0a018d1afd364237e51ca8ed43ea1aabb1): update pass documentation with password-name
### Fixes #228: Make '
- [52a577e](https://github.com/go-jira/go-jira/commit/52a577ea48afea9efb7a1f4163301129a66f7b76): ' gpg files temporary to fix go mod
- Fixes [#228](https://github.com/go-jira/go-jira/issues/228)### Merge Branch 'Make-Password-Source-Binary-Exchangeable' Of Https
- [e26fbfc](https://github.com/go-jira/go-jira/commit/e26fbfcb142f2ce8c7c33a977d4cf0b436d743eb): //github.com/patrickpichler/jira into patrickpichler-make-password-source-binary-exchangeable
### README
- [098d963](https://github.com/go-jira/go-jira/commit/098d963881322c2b2efba48ef6a39f235bdae881): trim down the content
### T
- [d237e86](https://github.com/go-jira/go-jira/commit/d237e86cda3812b23f432e90d120ec21e749a854): rename to _t to fix module support
- Fixes [#228](https://github.com/go-jira/go-jira/issues/228)### Update All Usage Of User.Name To User.AccountId For Privacy Migration: Https
- [a26683e](https://github.com/go-jira/go-jira/commit/a26683e01dc7e161e735b1b387d1633bc32da2fe): //developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/
### Pull Requests
- Merge pull request [#318](https://github.com/go-jira/go-jira/issues/318) from jrschumacher/patch-1
- Merge pull request [#317](https://github.com/go-jira/go-jira/issues/317) from go-jira/privacy-migration
- Merge pull request [#302](https://github.com/go-jira/go-jira/issues/302) from go-jira/simplify-template-tables
- Merge pull request [#292](https://github.com/go-jira/go-jira/issues/292) from pdecat/cache_password
- Merge pull request [#301](https://github.com/go-jira/go-jira/issues/301) from go-jira/allow-issue-ints
- Merge pull request [#286](https://github.com/go-jira/go-jira/issues/286) from patrickpichler/add-gopass-instructions-to-readme
- Merge pull request [#285](https://github.com/go-jira/go-jira/issues/285) from patrickpichler/add-gopass-support
- Merge pull request [#283](https://github.com/go-jira/go-jira/issues/283) from go-jira/sprig
- Merge pull request [#273](https://github.com/go-jira/go-jira/issues/273) from acaloiaro/master
- Merge pull request [#282](https://github.com/go-jira/go-jira/issues/282) from pcockwell/fix/choose-direct-transition-match-if-available
- Merge pull request [#280](https://github.com/go-jira/go-jira/issues/280) from go-jira/cut_v1_0_21
- Merge pull request [#275](https://github.com/go-jira/go-jira/issues/275) from go-jira/remove_gopkg_in
- Merge pull request [#278](https://github.com/go-jira/go-jira/issues/278) from go-jira/update-figtree
- Merge pull request [#276](https://github.com/go-jira/go-jira/issues/276) from go-jira/fix_228
- Merge pull request [#266](https://github.com/go-jira/go-jira/issues/266) from mbethke/fix-multiline-worklog-comment
- Merge pull request [#263](https://github.com/go-jira/go-jira/issues/263) from kojustin/master
- Merge pull request [#253](https://github.com/go-jira/go-jira/issues/253) from mvdan/module
- Merge pull request [#240](https://github.com/go-jira/go-jira/issues/240) from jgraglia/patch-1
- Merge pull request [#219](https://github.com/go-jira/go-jira/issues/219) from kerhac/master
- Merge pull request [#236](https://github.com/go-jira/go-jira/issues/236) from CodeLingoBot/rewrite
- Merge pull request [#245](https://github.com/go-jira/go-jira/issues/245) from justmiles/211
<a name="v1.0.22"></a>
## [v1.0.22] - 2019-09-30
### All
- [bb9790f](https://github.com/go-jira/go-jira/commit/bb9790f28783c1b82a3685a9c4657241e906826a): unindent some code
- [89fe2ec](https://github.com/go-jira/go-jira/commit/89fe2ecf16709511c3e04e02f7c7906a5ac6865a): convert to a Go module
### CI
- [80743e4](https://github.com/go-jira/go-jira/commit/80743e4da870a1febcc65d18d08242bb201b744d): test on Go 1.12.x, cleanup
### Docs
- [48c15e2](https://github.com/go-jira/go-jira/commit/48c15e2daa7b3f4c84526bd9f030828f378edfc2): update pass documentation with password-name
### Fixes #228: Make '
- [3984d0d](https://github.com/go-jira/go-jira/commit/3984d0d4848fdfe790f46ec18bd3b71782e36c32): ' gpg files temporary to fix go mod
- Fixes [#228](https://github.com/go-jira/go-jira/issues/228)### README
- [dc9a9de](https://github.com/go-jira/go-jira/commit/dc9a9de165859057e4596aa47961e84de34b0b4b): trim down the content
### T
- [8994b42](https://github.com/go-jira/go-jira/commit/8994b42f714f8fc5b224bda8b5835f003d96ef02): rename to _t to fix module support
- Fixes [#228](https://github.com/go-jira/go-jira/issues/228)
<a name="v1.0.21"></a>
## [v1.0.21] - 2019-09-16
### All
- [31c113d](https://github.com/go-jira/go-jira/commit/31c113d1baf2dba814bca3e1dcc519ab8b0269e9): unindent some code
- [f125ef3](https://github.com/go-jira/go-jira/commit/f125ef3fa9c7a64e8dfda9a643cadf0241b09bc7): convert to a Go module
### CI
- [664c5ca](https://github.com/go-jira/go-jira/commit/664c5cad246cbd4c861b615eb567d3874151d1a1): test on Go 1.12.x, cleanup
### Docs
- [d8189f0](https://github.com/go-jira/go-jira/commit/d8189f0a018d1afd364237e51ca8ed43ea1aabb1): update pass documentation with password-name
### Fixes #228: Make '
- [52a577e](https://github.com/go-jira/go-jira/commit/52a577ea48afea9efb7a1f4163301129a66f7b76): ' gpg files temporary to fix go mod
- Fixes [#228](https://github.com/go-jira/go-jira/issues/228)### README
- [098d963](https://github.com/go-jira/go-jira/commit/098d963881322c2b2efba48ef6a39f235bdae881): trim down the content
### T
- [d237e86](https://github.com/go-jira/go-jira/commit/d237e86cda3812b23f432e90d120ec21e749a854): rename to _t to fix module support
- Fixes [#228](https://github.com/go-jira/go-jira/issues/228)### Pull Requests
- Merge pull request [#275](https://github.com/go-jira/go-jira/issues/275) from go-jira/remove_gopkg_in
- Merge pull request [#278](https://github.com/go-jira/go-jira/issues/278) from go-jira/update-figtree
- Merge pull request [#276](https://github.com/go-jira/go-jira/issues/276) from go-jira/fix_228
- Merge pull request [#266](https://github.com/go-jira/go-jira/issues/266) from mbethke/fix-multiline-worklog-comment
- Merge pull request [#263](https://github.com/go-jira/go-jira/issues/263) from kojustin/master
- Merge pull request [#253](https://github.com/go-jira/go-jira/issues/253) from mvdan/module
- Merge pull request [#240](https://github.com/go-jira/go-jira/issues/240) from jgraglia/patch-1
- Merge pull request [#219](https://github.com/go-jira/go-jira/issues/219) from kerhac/master
- Merge pull request [#236](https://github.com/go-jira/go-jira/issues/236) from CodeLingoBot/rewrite
- Merge pull request [#245](https://github.com/go-jira/go-jira/issues/245) from justmiles/211
- Merge pull request [#220](https://github.com/go-jira/go-jira/issues/220) from ejsuncy/master
<a name="v1.0.20"></a>
## [v1.0.20] - 2018-08-04
<a name="v1.0.19"></a>
## [v1.0.19] - 2018-08-02
### Pull Requests
- Merge pull request [#197](https://github.com/go-jira/go-jira/issues/197) from kojiromike/spellcheck
<a name="v1.0.18"></a>
## [v1.0.18] - 2018-07-29
### They Broke Golang.Org/X/Net: ERROR: Vendor/Golang.Org/X/Net/Proxy/Socks5.Go:11:2
- [7191c77](https://github.com/go-jira/go-jira/commit/7191c7751b2d18d7f951d089fa3235acf5748d4b): use of internal package not allowed
### Pull Requests
- Merge pull request [#178](https://github.com/go-jira/go-jira/issues/178) from vergenzt/patch-1
<a name="v1.0.17"></a>
## [v1.0.17] - 2018-04-15
### [#157] Add `Password-Directory
- [06b26c9](https://github.com/go-jira/go-jira/commit/06b26c9e00384318ec7a51fa1c5ff5de63ea686b): path` to allow overriding PASSWORD_STORE_DIR from configs
- [#157](https://github.com/go-jira/go-jira/issues/157)### Pull Requests
- Merge pull request [#161](https://github.com/go-jira/go-jira/issues/161) from vanniktech/patch-1
<a name="v1.0.16"></a>
## [v1.0.16] - 2018-04-01
### Pull Requests
- Merge pull request [#150](https://github.com/go-jira/go-jira/issues/150) from catskul/parameterized-go-makefile
- Merge pull request [#153](https://github.com/go-jira/go-jira/issues/153) from catskul/document-shell-completion
- Merge pull request [#152](https://github.com/go-jira/go-jira/issues/152) from catskul/fix-missing-priority
<a name="v1.0.15"></a>
## [v1.0.15] - 2018-03-08
### Pull Requests
- Merge pull request [#151](https://github.com/go-jira/go-jira/issues/151) from catskul/build-instructions
- Merge pull request [#142](https://github.com/go-jira/go-jira/issues/142) from anthonyrisinger/patch-1
<a name="v1.0.14"></a>
## [v1.0.14] - 2017-11-04
### Pull Requests
- Merge pull request [#130](https://github.com/go-jira/go-jira/issues/130) from onionjake/master
<a name="v1.0.13"></a>
## [v1.0.13] - 2017-10-28
### Pull Requests
- Merge pull request [#126](https://github.com/go-jira/go-jira/issues/126) from schorsch3000/master
- Merge pull request [#129](https://github.com/go-jira/go-jira/issues/129) from blachniet/logout-help-typo-fix
- Merge pull request [#124](https://github.com/go-jira/go-jira/issues/124) from gvol/master
- Merge pull request [#128](https://github.com/go-jira/go-jira/issues/128) from mivok/escape-issuetype
<a name="v1.0.12"></a>
## [v1.0.12] - 2017-10-04
<a name="v1.0.11"></a>
## [v1.0.11] - 2017-09-26
<a name="v1.0.10"></a>
## [v1.0.10] - 2017-09-18
<a name="v1.0.9"></a>
## [v1.0.9] - 2017-09-17
<a name="v1.0.8"></a>
## [v1.0.8] - 2017-09-17
<a name="v1.0.7"></a>
## [v1.0.7] - 2017-09-15
<a name="v1.0.6"></a>
## [v1.0.6] - 2017-09-13
## 1.0.21 - 2019-09-16
<a name="v1.0.5"></a>
## [v1.0.5] - 2017-09-11
* [[#277](https://github.com/Netflix-Skunkworks/go-jira/issues/277)] update figtree to latest [Cory Bennett] [[0e520a4](https://github.com/Netflix-Skunkworks/go-jira/commit/0e520a4)]
* Switch over to using github.com/go-jira/jira, from gopkg.in [Mike Pountney] [[27f57b2](https://github.com/Netflix-Skunkworks/go-jira/commit/27f57b2)]
* fix worklog template to allow multiline comments [Matthias Bethke] [[43e07f1](https://github.com/Netflix-Skunkworks/go-jira/commit/43e07f1)]
* Allow reading password from stdin [Justin Ko] [[225e1dc](https://github.com/Netflix-Skunkworks/go-jira/commit/225e1dc)]
* all: unindent some code [Daniel Martí] [[31c113d](https://github.com/Netflix-Skunkworks/go-jira/commit/31c113d)]
* don't use ReadAll when decoding JSON [Daniel Martí] [[9bcdcc1](https://github.com/Netflix-Skunkworks/go-jira/commit/9bcdcc1)]
* start making staticcheck happier [Daniel Martí] [[9b9186f](https://github.com/Netflix-Skunkworks/go-jira/commit/9b9186f)]
* all: convert to a Go module [Daniel Martí] [[f125ef3](https://github.com/Netflix-Skunkworks/go-jira/commit/f125ef3)]
* CI: test on Go 1.12.x, cleanup [Daniel Martí] [[664c5ca](https://github.com/Netflix-Skunkworks/go-jira/commit/664c5ca)]
* make automatic pagination on search optional, fix tests [Cory Bennett] [[36c99ce](https://github.com/Netflix-Skunkworks/go-jira/commit/36c99ce)]
* prefer defer resp.Body.Close to avoid leaks on subsequent errors [Cory Bennett] [[181bd74](https://github.com/Netflix-Skunkworks/go-jira/commit/181bd74)]
* add pagination to search [Miles Maddox] [[76dd1d8](https://github.com/Netflix-Skunkworks/go-jira/commit/76dd1d8)]
* Fix function comments based on best practices from Effective Go [CodeLingo Bot] [[23ac118](https://github.com/Netflix-Skunkworks/go-jira/commit/23ac118)]
* [[#201](https://github.com/Netflix-Skunkworks/go-jira/issues/201)] update required library, failing to populate cookiejar from cookies file [Cory Bennett] [[ee69afa](https://github.com/Netflix-Skunkworks/go-jira/commit/ee69afa)]
<a name="v1.0.4"></a>
## [v1.0.4] - 2017-09-08
## 1.0.20 - 2018-08-04
<a name="v1.0.3"></a>
## [v1.0.3] - 2017-09-06
* [[#201](https://github.com/Netflix-Skunkworks/go-jira/issues/201)] update required library, failing to populate cookiejar from cookies file [Cory Bennett] [[ee69afa](https://github.com/Netflix-Skunkworks/go-jira/commit/ee69afa)]
<a name="v1.0.2"></a>
## [v1.0.2] - 2017-09-06
## 1.0.19 - 2018-08-02
<a name="v1.0.1"></a>
## [v1.0.1] - 2017-09-06
* [[#199](https://github.com/Netflix-Skunkworks/go-jira/issues/199)] [[#198](https://github.com/Netflix-Skunkworks/go-jira/issues/198)] update http client library, fix issues with internal login retries [Cory Bennett] [[0cba806](https://github.com/Netflix-Skunkworks/go-jira/commit/0cba806)]
<a name="v1.0.0"></a>
## [v1.0.0] - 2017-09-05
## 1.0.18 - 2018-07-29
<a name="v0.1.15"></a>
## [v0.1.15] - 2017-08-25
### Pull Requests
- Merge pull request [#104](https://github.com/go-jira/go-jira/issues/104) from wrouesnel/keyring-update
- Merge pull request [#90](https://github.com/go-jira/go-jira/issues/90) from bbaugher/master
* [[#196](https://github.com/Netflix-Skunkworks/go-jira/issues/196)] add `jira session` command to show session information if user is authenticated [Cory Bennett] [[f592107](https://github.com/Netflix-Skunkworks/go-jira/commit/f592107)]
* [[#192](https://github.com/Netflix-Skunkworks/go-jira/issues/192)] fix template usage for 'fixVersions' in transition template [Cory Bennett] [[c9a4e30](https://github.com/Netflix-Skunkworks/go-jira/commit/c9a4e30)]
* move HandleExit to the jiracli package [Cory Bennett] [[ef9b731](https://github.com/Netflix-Skunkworks/go-jira/commit/ef9b731)]
* they broke golang.org/x/net: ERROR: vendor/golang.org/x/net/proxy/socks5.go:11:2: use of internal package not allowed [Cory Bennett] [[7191c77](https://github.com/Netflix-Skunkworks/go-jira/commit/7191c77)]
* udpate deps [Cory Bennett] [[d16bcc2](https://github.com/Netflix-Skunkworks/go-jira/commit/d16bcc2)]
* udpate for figtree api changes [Cory Bennett] [[07ba74b](https://github.com/Netflix-Skunkworks/go-jira/commit/07ba74b)]
* udpate to use latest dep, update figtree [Cory Bennett] [[462ef1c](https://github.com/Netflix-Skunkworks/go-jira/commit/462ef1c)]
* [[#171](https://github.com/Netflix-Skunkworks/go-jira/issues/171)] change proposed PasswordPath to PasswordName [Cory Bennett] [[213a7e0](https://github.com/Netflix-Skunkworks/go-jira/commit/213a7e0)]
* add pass path to config [dvogt23] [[fa01ff5](https://github.com/Netflix-Skunkworks/go-jira/commit/fa01ff5)]
## 1.0.17 - 2018-04-15
<a name="v0.1.14"></a>
## [v0.1.14] - 2017-05-10
* fix IsTerminal usage for windows [Cory Bennett] [[7f9595c](https://github.com/Netflix-Skunkworks/go-jira/commit/7f9595c)]
* [[#166](https://github.com/Netflix-Skunkworks/go-jira/issues/166)] fix issue when editing templates specified with full path [Cory Bennett] [[d787ac0](https://github.com/Netflix-Skunkworks/go-jira/commit/d787ac0)]
* only prompt on logout if stdin and stdout are terminals [Cory Bennett] [[09a61c3](https://github.com/Netflix-Skunkworks/go-jira/commit/09a61c3)]
* [[#163](https://github.com/Netflix-Skunkworks/go-jira/issues/163)] fix url path join logic [Cory Bennett] [[9146346](https://github.com/Netflix-Skunkworks/go-jira/commit/9146346)]
* [[#160](https://github.com/Netflix-Skunkworks/go-jira/issues/160)] prompt when api-token is invalid to get new token [Cory Bennett] [[e639cce](https://github.com/Netflix-Skunkworks/go-jira/commit/e639cce)]
* [[#157](https://github.com/Netflix-Skunkworks/go-jira/issues/157)] add `password-directory: path` to allow overriding PASSWORD_STORE_DIR from configs [Cory Bennett] [[06b26c9](https://github.com/Netflix-Skunkworks/go-jira/commit/06b26c9)]
* [[#160](https://github.com/Netflix-Skunkworks/go-jira/issues/160)] allow `jira logout` to delete your api-token from keychain [Cory Bennett] [[bd3cf99](https://github.com/Netflix-Skunkworks/go-jira/commit/bd3cf99)]
<a name="v0.1.13"></a>
## [v0.1.13] - 2017-04-24
### Pull Requests
- Merge pull request [#78](https://github.com/go-jira/go-jira/issues/78) from davidreuss/generic-issuelink
- Merge pull request [#77](https://github.com/go-jira/go-jira/issues/77) from davidreuss/fix-start-parameter-for-pagination
## 1.0.16 - 2018-04-01
* [[#159](https://github.com/Netflix-Skunkworks/go-jira/issues/159)] fix `slice bounds out of range` error in `abbrev` template function [Cory Bennett] [[359bec2](https://github.com/Netflix-Skunkworks/go-jira/commit/359bec2)]
* [[#158](https://github.com/Netflix-Skunkworks/go-jira/issues/158)] always print usage to stdout [Cory Bennett] [[79c83f6](https://github.com/Netflix-Skunkworks/go-jira/commit/79c83f6)]
<a name="v0.1.12"></a>
## [v0.1.12] - 2017-03-22
### Pull Requests
- Merge pull request [#74](https://github.com/go-jira/go-jira/issues/74) from clausb/BrowseOnWindows
## 1.0.15 - 2018-03-08
* [[#147](https://github.com/Netflix-Skunkworks/go-jira/issues/147)] [[#148](https://github.com/Netflix-Skunkworks/go-jira/issues/148)] add support for api token based authentication [Cory Bennett] [[edb0662](https://github.com/Netflix-Skunkworks/go-jira/commit/edb0662)]
* refactor to simplify main [Cory Bennett] [[43ebc84](https://github.com/Netflix-Skunkworks/go-jira/commit/43ebc84)] [[0d7c1a7](https://github.com/Netflix-Skunkworks/go-jira/commit/0d7c1a7)]
* [[#145](https://github.com/Netflix-Skunkworks/go-jira/issues/145)] fix to match AuthProvider interface [Cory Bennett] [[80325a5](https://github.com/Netflix-Skunkworks/go-jira/commit/80325a5)]
* [[#141](https://github.com/Netflix-Skunkworks/go-jira/issues/141)] better handling in responseError for non-json error responses [Cory Bennett] [[20a9666](https://github.com/Netflix-Skunkworks/go-jira/commit/20a9666)]
* Update unexportTemplates.go [GitHub] [[6da9974](https://github.com/Netflix-Skunkworks/go-jira/commit/6da9974)]
* [[#139](https://github.com/Netflix-Skunkworks/go-jira/issues/139)] add shellquote and toMinJson template functions [Cory Bennett] [[8c7ca38](https://github.com/Netflix-Skunkworks/go-jira/commit/8c7ca38)]
* [[#137](https://github.com/Netflix-Skunkworks/go-jira/issues/137)] update kingpeon dep to allow access to dynamic command structure [Cory Bennett] [[425fa63](https://github.com/Netflix-Skunkworks/go-jira/commit/425fa63)]
* field name is "comment" not "comments" [Cory Bennett] [[464742c](https://github.com/Netflix-Skunkworks/go-jira/commit/464742c)]
<a name="v0.1.11"></a>
## [v0.1.11] - 2017-02-26
## 1.0.14 - 2017-11-04
<a name="v0.1.10"></a>
## [v0.1.10] - 2017-02-08
### Doc Tweak
- [e6faa4e](https://github.com/go-jira/go-jira/commit/e6faa4eab1a8d6a7fb624b79bb58a641d02e876b): add info for setting username
### Merge Branch 'Master' Of Github.Com
- [63bc2ae](https://github.com/go-jira/go-jira/commit/63bc2ae15a2ebafa16861965951800e0d5c122bd): Netflix-Skunkworks/go-jira
### Refactor Password Source, Allow For "Pass" To Be Used, Update Tests To Use `Password-Source
- [cb70941](https://github.com/go-jira/go-jira/commit/cb70941aad2b8198f5c8ad8d1e1a7a98dc820cd9): pass`
### Pull Requests
- Merge pull request [#65](https://github.com/go-jira/go-jira/issues/65) from mlbright/patch-1
- Merge pull request [#64](https://github.com/go-jira/go-jira/issues/64) from astrostl/patch-2
- Merge pull request [#62](https://github.com/go-jira/go-jira/issues/62) from astrostl/patch-1
* [[#131](https://github.com/Netflix-Skunkworks/go-jira/issues/131)] fix parsing global options before command execution (allow unixproxy/socksproxy to be set in config.yml) [Cory Bennett] [[042bc48](https://github.com/Netflix-Skunkworks/go-jira/commit/042bc48)]
* add/update deps [Cory Bennett] [[a2e36e8](https://github.com/Netflix-Skunkworks/go-jira/commit/a2e36e8)]
* add support for using socks proxy [onionjake] [[ff985f9](https://github.com/Netflix-Skunkworks/go-jira/commit/ff985f9)]
## 1.0.13 - 2017-10-28
<a name="v0.1.9"></a>
## [v0.1.9] - 2016-12-18
### Fix(Http)
- [b326623](https://github.com/go-jira/go-jira/commit/b326623ed22677a3ff76d2c4c67bb7ca7ecb3877): Add proxy transport
- [72c78c6](https://github.com/go-jira/go-jira/commit/72c78c6c1c63a70d837c8e367754792c8a30ae06): Add proxy transport
### Merge Branch 'Master' Of Github.Com
- [ac515e2](https://github.com/go-jira/go-jira/commit/ac515e2743e1bcf5f492a0e25d2b084f3311f0d0): Netflix-Skunkworks/go-jira
### Pull Requests
- Merge pull request [#61](https://github.com/go-jira/go-jira/issues/61) from sylus/feature-proxy
- Merge pull request [#60](https://github.com/go-jira/go-jira/issues/60) from facundoolano/patch-1
* fix transition command [Cory Bennett] [[9597f9b](https://github.com/Netflix-Skunkworks/go-jira/commit/9597f9b)]
* fix default values to load after parsing configs [Cory Bennett] [[c9b5054](https://github.com/Netflix-Skunkworks/go-jira/commit/c9b5054)]
* add test to make sure IssueType.Fields does not disappear on regeneration [Cory Bennett] [[3966def](https://github.com/Netflix-Skunkworks/go-jira/commit/3966def)]
* add tests for validating changes to auto-generated jiradata files [Cory Bennett] [[41d1a7c](https://github.com/Netflix-Skunkworks/go-jira/commit/41d1a7c)]
* Fix typo in 'logout' command help [Cory Bennett] [[9000777](https://github.com/Netflix-Skunkworks/go-jira/commit/9000777)]
* Add URL escaping to an additional issuetype call [Cory Bennett] [[7bfa241](https://github.com/Netflix-Skunkworks/go-jira/commit/7bfa241)]
* Add --resolution option [Cory Bennett] [[e6600cf](https://github.com/Netflix-Skunkworks/go-jira/commit/e6600cf)]
* Create Metadata Not Populated Correctly [Dillon Buchanan] [[093c510](https://github.com/Netflix-Skunkworks/go-jira/commit/093c510)]
* add regexReplace template function [Dirk Heilig] [[d3e294e](https://github.com/Netflix-Skunkworks/go-jira/commit/d3e294e)]
## 1.0.12 - 2017-10-04
* add `{{env.VARNAME}}` template support to allow use of env vars [Cory Bennett] [[4d74554](https://github.com/Netflix-Skunkworks/go-jira/commit/4d74554)]
## 1.0.11 - 2017-09-26
* [[#115](https://github.com/Netflix-Skunkworks/go-jira/issues/115)] fix transition template for description [Cory Bennett] [[986cc78](https://github.com/Netflix-Skunkworks/go-jira/commit/986cc78)]
* update edit command to set queryFields on search to match what is used in template [Cory Bennett] [[3913726](https://github.com/Netflix-Skunkworks/go-jira/commit/3913726)]
* fix edit with query loop, allow continuation when not submitting previous issue [Cory Bennett] [[0ba8aa0](https://github.com/Netflix-Skunkworks/go-jira/commit/0ba8aa0)]
* fix edit when priority is not set [Cory Bennett] [[098eb99](https://github.com/Netflix-Skunkworks/go-jira/commit/098eb99)]
* flatten CommandRegistry list to make it more readable [Cory Bennett] [[2ddaed2](https://github.com/Netflix-Skunkworks/go-jira/commit/2ddaed2)]
## 1.0.10 - 2017-09-18
* clean up usage formatting, print aliases [Cory Bennett] [[9f433ac](https://github.com/Netflix-Skunkworks/go-jira/commit/9f433ac)]
* fix edit [Cory Bennett] [[4c6b36c](https://github.com/Netflix-Skunkworks/go-jira/commit/4c6b36c)]
* fix named query template expansion [Cory Bennett] [[a8eaa97](https://github.com/Netflix-Skunkworks/go-jira/commit/a8eaa97)]
* fix usage message [Cory Bennett] [[cd3cfd8](https://github.com/Netflix-Skunkworks/go-jira/commit/cd3cfd8)]
## 1.0.9 - 2017-09-17
* need issuetype to use the default list table template now [Cory Bennett] [[3e8b9bd](https://github.com/Netflix-Skunkworks/go-jira/commit/3e8b9bd)]
* [[#102](https://github.com/Netflix-Skunkworks/go-jira/issues/102)] add issuetype into the default queryfields and add it to the default `table` list template [Cory Bennett] [[c9d8dfb](https://github.com/Netflix-Skunkworks/go-jira/commit/c9d8dfb)]
## 1.0.8 - 2017-09-17
* [[#100](https://github.com/Netflix-Skunkworks/go-jira/issues/100)] add support for posting, fetching, listing and removing attachments [Cory Bennett] [[66eb7bf](https://github.com/Netflix-Skunkworks/go-jira/commit/66eb7bf)]
## 1.0.7 - 2017-09-15
* [[#87](https://github.com/Netflix-Skunkworks/go-jira/issues/87)] add various commands for interacting with epics [Cory Bennett] [[893454f](https://github.com/Netflix-Skunkworks/go-jira/commit/893454f)]
## 1.0.6 - 2017-09-13
* tweaks for templates in named queries to work better [Cory Bennett] [[00cba79](https://github.com/Netflix-Skunkworks/go-jira/commit/00cba79)]
* [[#99](https://github.com/Netflix-Skunkworks/go-jira/issues/99)] add support for named queries to be stored in configs [Cory Bennett] [[fb43753](https://github.com/Netflix-Skunkworks/go-jira/commit/fb43753)]
* [[#98](https://github.com/Netflix-Skunkworks/go-jira/issues/98)] add `--status` option for JQL filter on status with `list` command [Cory Bennett] [[5da04c1](https://github.com/Netflix-Skunkworks/go-jira/commit/5da04c1)]
## 1.0.5 - 2017-09-11
<a name="v0.1.8"></a>
## [v0.1.8] - 2016-11-24
### Pull Requests
- Merge pull request [#53](https://github.com/go-jira/go-jira/issues/53) from jshirley/master
* use --gjq for GJson Query to filter json response data [Cory Bennett] [[608e586](https://github.com/Netflix-Skunkworks/go-jira/commit/608e586)]
* fix field tag syntax [Cory Bennett] [[2c552ac](https://github.com/Netflix-Skunkworks/go-jira/commit/2c552ac)]
* add '{{jira}}' template macro to refer to path of currently running jira command [Cory Bennett] [[941824d](https://github.com/Netflix-Skunkworks/go-jira/commit/941824d)]
## 1.0.4 - 2017-09-08
* update deps for kingpeon update use os.exec instead of syscall.exec for windows [Cory Bennett] [[86b963b](https://github.com/Netflix-Skunkworks/go-jira/commit/86b963b)]
## 1.0.3 - 2017-09-06
* [[#66](https://github.com/Netflix-Skunkworks/go-jira/issues/66)] add --started option to `jira worklog add` to change the start time for worklog [Cory Bennett] [[e6faee1](https://github.com/Netflix-Skunkworks/go-jira/commit/e6faee1)]
* [[#45](https://github.com/Netflix-Skunkworks/go-jira/issues/45)] automatically add comment to issue even if transition does not support comment updates during transtion [Cory Bennett] [[c4be59c](https://github.com/Netflix-Skunkworks/go-jira/commit/c4be59c)]
## 1.0.2 - 2017-09-06
<a name="v0.1.7"></a>
## [v0.1.7] - 2016-08-24
### Pull Requests
- Merge pull request [#52](https://github.com/go-jira/go-jira/issues/52) from dbrower/master
* update dependencies [Cory Bennett] [[aa876cd](https://github.com/Netflix-Skunkworks/go-jira/commit/aa876cd)]
* update for github.com/AlecAivazis/survey => gopkg.in/AlecAivazis/survey.v1 package [Cory Bennett] [[9453179](https://github.com/Netflix-Skunkworks/go-jira/commit/9453179)]
* use stdout to determin output terminal size [Cory Bennett] [[4d79af4](https://github.com/Netflix-Skunkworks/go-jira/commit/4d79af4)]
## 1.0.1 - 2017-09-06
* [[#13](https://github.com/Netflix-Skunkworks/go-jira/issues/13)] change default input syntax to not require escaping for special characters [Cory Bennett] [[1106558](https://github.com/Netflix-Skunkworks/go-jira/commit/1106558)]
<a name="v0.1.6"></a>
## [v0.1.6] - 2016-08-21
## 1.0.0 - 2017-09-05
<a name="v0.1.5"></a>
## [v0.1.5] - 2016-08-21
* fix build for windows [Cory Bennett] [[1b854da](https://github.com/Netflix-Skunkworks/go-jira/commit/1b854da)]
* change the default log output format [Cory Bennett] [[f1b8c64](https://github.com/Netflix-Skunkworks/go-jira/commit/f1b8c64)]
* tweak auto-login so it does not print the standard `jira login` command output [Cory Bennett] [[49f6cdc](https://github.com/Netflix-Skunkworks/go-jira/commit/49f6cdc)]
* add --quiet global option [Cory Bennett] [[c226077](https://github.com/Netflix-Skunkworks/go-jira/commit/c226077)]
* refactor to allow for --insecure and --unixproxy arguments [Cory Bennett] [[c0358eb](https://github.com/Netflix-Skunkworks/go-jira/commit/c0358eb)]
* handle html response on expired cookies (require X-Ausername header to always be present) [Cory Bennett] [[21920c5](https://github.com/Netflix-Skunkworks/go-jira/commit/21920c5)]
* allow login prompt to be interrupted [Cory Bennett] [[7ab6c22](https://github.com/Netflix-Skunkworks/go-jira/commit/7ab6c22)]
* fmt -> log typo [Cory Bennett] [[bccf09f](https://github.com/Netflix-Skunkworks/go-jira/commit/bccf09f)]
* make ~/.jira.d directory if not already present [Cory Bennett] [[e72479c](https://github.com/Netflix-Skunkworks/go-jira/commit/e72479c)]
* fix go vet [Cory Bennett] [[e04b506](https://github.com/Netflix-Skunkworks/go-jira/commit/e04b506)]
* fix tests [Cory Bennett] [[ba35f55](https://github.com/Netflix-Skunkworks/go-jira/commit/ba35f55)]
* add OK printf [Cory Bennett] [[dc02181](https://github.com/Netflix-Skunkworks/go-jira/commit/dc02181)]
* change --method to use -M for backwards compat [Cory Bennett] [[b120c0b](https://github.com/Netflix-Skunkworks/go-jira/commit/b120c0b)]
* add resolution to dup'd issues when necessary [Cory Bennett] [[2638396](https://github.com/Netflix-Skunkworks/go-jira/commit/2638396)]
* call correct function for `labels remove|set` commands [Cory Bennett] [[ad1a62a](https://github.com/Netflix-Skunkworks/go-jira/commit/ad1a62a)]
* data argument is optional (for GET and DELETE requests) [Cory Bennett] [[4b60313](https://github.com/Netflix-Skunkworks/go-jira/commit/4b60313)]
* fix usage, overrides not serialized correctly [Cory Bennett] [[84119a2](https://github.com/Netflix-Skunkworks/go-jira/commit/84119a2)]
* fix `jira ISSUE-123` command line parsing [Cory Bennett] [[fa4ac25](https://github.com/Netflix-Skunkworks/go-jira/commit/fa4ac25)]
* add logger object to jiracmd [Cory Bennett] [[aed952b](https://github.com/Netflix-Skunkworks/go-jira/commit/aed952b)]
* refactor for GlobalOptions and CommonOptions [Cory Bennett] [[979da1f](https://github.com/Netflix-Skunkworks/go-jira/commit/979da1f)]
* move commands from jiracli package to jiracmd package [Cory Bennett] [[0a5510b](https://github.com/Netflix-Skunkworks/go-jira/commit/0a5510b)]
* use jiracli.Error object to disambiguate between kingpin errors and cli errors [Cory Bennett] [[fb1bfeb](https://github.com/Netflix-Skunkworks/go-jira/commit/fb1bfeb)]
* fix stray newline for list table template [Cory Bennett] [[36c26c5](https://github.com/Netflix-Skunkworks/go-jira/commit/36c26c5)]
* fix dynamic table output when not on tty [Cory Bennett] [[3942f6f](https://github.com/Netflix-Skunkworks/go-jira/commit/3942f6f)]
* when using --verbose set the JIRA_DEBUG environment variable so custom-commands can auto enable verbose output [Cory Bennett] [[da9a2b2](https://github.com/Netflix-Skunkworks/go-jira/commit/da9a2b2)]
* make `jira ISSUE-123` usage call `jira view ISSUE-123` [Cory Bennett] [[ec0858b](https://github.com/Netflix-Skunkworks/go-jira/commit/ec0858b)]
* integrate kingpeon library to allow for custom commands via configuration [Cory Bennett] [[301a61f](https://github.com/Netflix-Skunkworks/go-jira/commit/301a61f)]
* use terminal width to adjust list table output [Cory Bennett] [[2a081dd](https://github.com/Netflix-Skunkworks/go-jira/commit/2a081dd)]
* set yaml/json tags for option structs [Cory Bennett] [[f52d2c4](https://github.com/Netflix-Skunkworks/go-jira/commit/f52d2c4)]
* update generated data files [Cory Bennett] [[c89f11d](https://github.com/Netflix-Skunkworks/go-jira/commit/c89f11d)]
* automatically login when anonymous user detected [Cory Bennett] [[21add54](https://github.com/Netflix-Skunkworks/go-jira/commit/21add54)]
* refactor trivial objects in favor of arguments to static functions [Cory Bennett] [[1f345ce](https://github.com/Netflix-Skunkworks/go-jira/commit/1f345ce)]
* set JIRA_OPERATION when parsing configs. Use figtree config types for options to make defaulting work [Cory Bennett] [[5716a7c](https://github.com/Netflix-Skunkworks/go-jira/commit/5716a7c)]
* add better handing for usage error [Cory Bennett] [[b235dcc](https://github.com/Netflix-Skunkworks/go-jira/commit/b235dcc)]
* adding `request` command, removing dead code [Cory Bennett] [[56b1c9d](https://github.com/Netflix-Skunkworks/go-jira/commit/56b1c9d)]
* adding Do required for request language [Cory Bennett] [[a1c2849](https://github.com/Netflix-Skunkworks/go-jira/commit/a1c2849)]
* add `browse` command and implement -b option for most operations [Cory Bennett] [[a91b9d5](https://github.com/Netflix-Skunkworks/go-jira/commit/a91b9d5)]
* fix IssueAssign [Cory Bennett] [[f32cc70](https://github.com/Netflix-Skunkworks/go-jira/commit/f32cc70)]
* merge in update for upstream changes [#104](https://github.com/Netflix-Skunkworks/go-jira/issues/104) [Cory Bennett] [[19d8686](https://github.com/Netflix-Skunkworks/go-jira/commit/19d8686)]
* add `export-templates` command [Cory Bennett] [[abaad56](https://github.com/Netflix-Skunkworks/go-jira/commit/abaad56)]
* add `issuetypes` command [Cory Bennett] [[da39323](https://github.com/Netflix-Skunkworks/go-jira/commit/da39323)]
* add `components` command [Cory Bennett] [[0bd3ca2](https://github.com/Netflix-Skunkworks/go-jira/commit/0bd3ca2)]
* add `component add` command [Cory Bennett] [[cc90610](https://github.com/Netflix-Skunkworks/go-jira/commit/cc90610)]
* add `take`, `unassign` and `assign|give` commands [Cory Bennett] [[959524a](https://github.com/Netflix-Skunkworks/go-jira/commit/959524a)]
* adding `labels [add|set|remove]` commands [Cory Bennett] [[9161861](https://github.com/Netflix-Skunkworks/go-jira/commit/9161861)]
* add `comment` command [Cory Bennett] [[f0b08c5](https://github.com/Netflix-Skunkworks/go-jira/commit/f0b08c5)]
* add `watch` command [Cory Bennett] [[ec0ac3c](https://github.com/Netflix-Skunkworks/go-jira/commit/ec0ac3c)]
* add `rank ISSUE after|before ISSUE` command [Cory Bennett] [[8b863d2](https://github.com/Netflix-Skunkworks/go-jira/commit/8b863d2)]
* add `vote` command [Cory Bennett] [[a08c92f](https://github.com/Netflix-Skunkworks/go-jira/commit/a08c92f)]
* add `issuelinktypes` command [Cory Bennett] [[37f81a4](https://github.com/Netflix-Skunkworks/go-jira/commit/37f81a4)]
* add `issuelink` command [Cory Bennett] [[aacc9f4](https://github.com/Netflix-Skunkworks/go-jira/commit/aacc9f4)]
* fix closing duplicate issue on `dup` command [Cory Bennett] [[fc696c3](https://github.com/Netflix-Skunkworks/go-jira/commit/fc696c3)]
* rewrite checkpoint [Cory Bennett] [[36632a5](https://github.com/Netflix-Skunkworks/go-jira/commit/36632a5)]
<a name="v0.1.4"></a>
## [v0.1.4] - 2016-08-12
## 0.1.14 - 2017-05-10
<a name="v0.1.3"></a>
## [v0.1.3] - 2016-07-30
### Pull Requests
- Merge pull request [#24](https://github.com/go-jira/go-jira/issues/24) from mikepea/edit_template_common
* fix unsafe casting for --quiet flag [Cory Bennett] [[6f29f43](https://github.com/Netflix-Skunkworks/go-jira/commit/6f29f43)]
* [[#80](https://github.com/Netflix-Skunkworks/go-jira/issues/80)] add `jira unassign` and `jira give ISSUE --default` commands [Cory Bennett] [[03d8633](https://github.com/Netflix-Skunkworks/go-jira/commit/03d8633)]
## 0.1.13 - 2017-04-24
* work around `github.com/tmc/keyring` compile error for windows [Cory Bennett] [[85298e9](https://github.com/Netflix-Skunkworks/go-jira/commit/85298e9)]
* Added generic issuelink command [David Reuss] [[cc54d11](https://github.com/Netflix-Skunkworks/go-jira/commit/cc54d11)]
* Added --start parameter for pagination on results [David Reuss] [[9b94d9e](https://github.com/Netflix-Skunkworks/go-jira/commit/9b94d9e)]
## 0.1.12 - 2017-03-22
* Implement "browse" subcommand on Windows [Claus Brod] [[ca333d8](https://github.com/Netflix-Skunkworks/go-jira/commit/ca333d8)]
## 0.1.11 - 2017-02-26
* [[#69](https://github.com/Netflix-Skunkworks/go-jira/issues/69)] add subtask command [Cory Bennett] [[21a2ed5](https://github.com/Netflix-Skunkworks/go-jira/commit/21a2ed5)]
## 0.1.10 - 2017-02-08
* set GPG_TTY in .bashrc [Cory Bennett] [[b1e552f](https://github.com/Netflix-Skunkworks/go-jira/commit/b1e552f)]
* force password in case password already exists [Cory Bennett] [[d5a2c3b](https://github.com/Netflix-Skunkworks/go-jira/commit/d5a2c3b)]
* refactor password source, allow for "pass" to be used, update tests to use `password-source: pass` [Cory Bennett] [[5a71939](https://github.com/Netflix-Skunkworks/go-jira/commit/5a71939)]
## 0.1.9 - 2016-12-18
* only warn about needing login when not already running the login command [Cory Bennett] [[6c24e55](https://github.com/Netflix-Skunkworks/go-jira/commit/6c24e55)]
* fix(http): Add proxy transport [William Hearn] [[4bd740b](https://github.com/Netflix-Skunkworks/go-jira/commit/4bd740b)] [[2dff6c9](https://github.com/Netflix-Skunkworks/go-jira/commit/2dff6c9)]
## 0.1.8 - 2016-11-24
* [[#12](https://github.com/Netflix-Skunkworks/go-jira/issues/12)] integrate with keyring for password storage and provide http basic auth credentials for every request since most jira services have websudo enabled with does not allow cookie based authentication [Cory Bennett] [[b8a6e57](https://github.com/Netflix-Skunkworks/go-jira/commit/b8a6e57)]
* Cleaning up usage [Jay Shirley] [[8add52b](https://github.com/Netflix-Skunkworks/go-jira/commit/8add52b)]
* Update usage [Jay Shirley] [[b56e32a](https://github.com/Netflix-Skunkworks/go-jira/commit/b56e32a)]
* use gopkg.in for links to maintain version compatibility [Cory Bennett] [[1414d1f](https://github.com/Netflix-Skunkworks/go-jira/commit/1414d1f)]
* golint [Cory Bennett] [[44cdebf](https://github.com/Netflix-Skunkworks/go-jira/commit/44cdebf)]
* add "rank" command allow ordering backlog issues in agile projects [Cory Bennett] [[e4cc9c6](https://github.com/Netflix-Skunkworks/go-jira/commit/e4cc9c6)]
* Adding a unixproxy mechanism [Jay Shirley] [[5b9c0dd](https://github.com/Netflix-Skunkworks/go-jira/commit/5b9c0dd)]
## 0.1.7 - 2016-08-24
* Prefer transition names which match exactly [Don Brower] [[e40f9c1](https://github.com/Netflix-Skunkworks/go-jira/commit/e40f9c1)]
* update tempates to make them more readable with space trimming added to go-1.6 [Cory Bennett] [[693b3e4](https://github.com/Netflix-Skunkworks/go-jira/commit/693b3e4)]
## 0.1.6 - 2016-08-21
* make "worklogs" command print output through template allow "add worklog" command to open edit template [Cory Bennett] [[cc3fbee](https://github.com/Netflix-Skunkworks/go-jira/commit/cc3fbee)]
* remove extra newline at end of worklogs template [Cory Bennett] [[d08ef15](https://github.com/Netflix-Skunkworks/go-jira/commit/d08ef15)]
* adding worklog related templates [Cory Bennett] [[ab1cd27](https://github.com/Netflix-Skunkworks/go-jira/commit/ab1cd27)]
## 0.1.5 - 2016-08-21
* update for golint [Cory Bennett] [[5a4e17c](https://github.com/Netflix-Skunkworks/go-jira/commit/5a4e17c)]
* fix for go vet [Cory Bennett] [[355fb42](https://github.com/Netflix-Skunkworks/go-jira/commit/355fb42)]
<a name="v0.1.2"></a>
## [v0.1.2] - 2016-06-29
## 0.1.4 - 2016-08-12
<a name="v0.1.1"></a>
## [v0.1.1] - 2016-06-28
### Merge Branch 'Master' Of Github.Com
- [dd0f5ef](https://github.com/go-jira/go-jira/commit/dd0f5efd3247157686c2c88817d3ad375de399ea): Netflix-Skunkworks/go-jira
### Pull Requests
- Merge pull request [#39](https://github.com/go-jira/go-jira/issues/39) from mikepea/system_template_dir
- Merge pull request [#38](https://github.com/go-jira/go-jira/issues/38) from jglick/patch-1
- Merge pull request [#37](https://github.com/go-jira/go-jira/issues/37) from tobyjoe/add-resource-expansion
- Merge pull request [#35](https://github.com/go-jira/go-jira/issues/35) from QuinnyPig/fix-readme
- Merge pull request [#34](https://github.com/go-jira/go-jira/issues/34) from jonathanio/fix/issuetypes-url-escaping
* when running "dups" on a Process Management Project type, you have to start/stop the task to resolve it [Cory Bennett] [[2c91905](https://github.com/Netflix-Skunkworks/go-jira/commit/2c91905)]
* allow for defaultResolution option for transition command [Cory Bennett] [[a328c2d](https://github.com/Netflix-Skunkworks/go-jira/commit/a328c2d)]
* add "backlog" command for Kanban related Issues [Cory Bennett] [[5d39b23](https://github.com/Netflix-Skunkworks/go-jira/commit/5d39b23)]
* fix --noedit flag with "dups" command [Cory Bennett] [[37c07fa](https://github.com/Netflix-Skunkworks/go-jira/commit/37c07fa)]
* add "votes" and "labels" to default view template [Cory Bennett] [[6f73b8c](https://github.com/Netflix-Skunkworks/go-jira/commit/6f73b8c)]
* add "blockerType" config param, for issueLinkType use for "blocks" command [Cory Bennett] [[30fd301](https://github.com/Netflix-Skunkworks/go-jira/commit/30fd301)]
* update gitter room [Cory Bennett] [[4b822b1](https://github.com/Netflix-Skunkworks/go-jira/commit/4b822b1)]
* default issuetype to "Bug" for project that have Bug, otherwise try "Task" [Cory Bennett] [[0c807b4](https://github.com/Netflix-Skunkworks/go-jira/commit/0c807b4)]
* make view template only show fields that have values [Cory Bennett] [[8238fe8](https://github.com/Netflix-Skunkworks/go-jira/commit/8238fe8)]
* make default create template only display fields if they are valid fields for the project [Cory Bennett] [[adc2ace](https://github.com/Netflix-Skunkworks/go-jira/commit/adc2ace)]
* ignore empty json fields when processing templates [Cory Bennett] [[f5f3e28](https://github.com/Netflix-Skunkworks/go-jira/commit/f5f3e28)]
* allow JIRA_LOG_FORMAT env variable to control log output format [Cory Bennett] [[469def0](https://github.com/Netflix-Skunkworks/go-jira/commit/469def0)]
* remove extraneous debug [Cory Bennett] [[752a94d](https://github.com/Netflix-Skunkworks/go-jira/commit/752a94d)]
* add logout command modify password prompt to echo masked password [Cory Bennett] [[8ad91be](https://github.com/Netflix-Skunkworks/go-jira/commit/8ad91be)]
* tweak cookies to store hostname dump all http request/response with --verbose [Cory Bennett] [[f93fe79](https://github.com/Netflix-Skunkworks/go-jira/commit/f93fe79)]
* load configs in order of closest to cwd (/etc/go-jira.yml is last) [Cory Bennett] [[f54267b](https://github.com/Netflix-Skunkworks/go-jira/commit/f54267b)]
## 0.1.3 - 2016-07-30
<a name="v0.1.0"></a>
## [v0.1.0] - 2016-01-29
### Add Component/Components Support
- [595a521](https://github.com/go-jira/go-jira/commit/595a5212b43be28e01a0d5a6cf98a8de89383e41): add and list for now.
### Merge Branch 'Master' Of Github.Com
- [9e90376](https://github.com/go-jira/go-jira/commit/9e90376816c295d3a75b4f51703c24fd95873625): Netflix-Skunkworks/go-jira
- [382bf4f](https://github.com/go-jira/go-jira/commit/382bf4faeb17198b54950a05b0fdb3e126af8d73): Netflix-Skunkworks/go-jira
### Pull Requests
- Merge pull request [#33](https://github.com/go-jira/go-jira/issues/33) from mikepea/make_jirad
- Merge pull request [#31](https://github.com/go-jira/go-jira/issues/31) from mikepea/component_mgmt
- Merge pull request [#30](https://github.com/go-jira/go-jira/issues/30) from mikepea/unwatch_support
- Merge pull request [#26](https://github.com/go-jira/go-jira/issues/26) from mikepea/vote_support
* [[#43](https://github.com/Netflix-Skunkworks/go-jira/issues/43)] add support for jira done|todo|prog commands [Cory Bennett] [[dd7d1cc](https://github.com/Netflix-Skunkworks/go-jira/commit/dd7d1cc)]
* Reporter is not generally editable. [Mike Pountney] [[a637b43](https://github.com/Netflix-Skunkworks/go-jira/commit/a637b43)]
## 0.1.2 - 2016-06-29
<a name="v0.0.20"></a>
## [v0.0.20] - 2016-01-21
### Correct Naming Of Parameter
- [8e66246](https://github.com/go-jira/go-jira/commit/8e662462dac6cccdf8af277797777caeff3ad2bc): set/add/remove are actions.
### Pull Requests
- Merge pull request [#27](https://github.com/go-jira/go-jira/issues/27) from blalor/insecure-skip-verify
- Merge pull request [#21](https://github.com/go-jira/go-jira/issues/21) from mikepea/label_command
- Merge pull request [#22](https://github.com/go-jira/go-jira/issues/22) from mikepea/library_break_out
- Merge pull request [#20](https://github.com/go-jira/go-jira/issues/20) from mikepea/add_join_template_func
* [[#44](https://github.com/Netflix-Skunkworks/go-jira/issues/44)] Close tmpfile before rename to work around "The process cannot access the file because it is being used by another process" error on windows. [Cory Bennett] [[0980f8e](https://github.com/Netflix-Skunkworks/go-jira/commit/0980f8e)]
## 0.1.1 - 2016-06-28
<a name="0.0.19"></a>
## [0.0.19] - 2015-12-09
* use USERPROFILE instead of HOME for windows, rework paths to use filepath.Join for better cross platform support [Cory Bennett] [[adcedc4](https://github.com/Netflix-Skunkworks/go-jira/commit/adcedc4)]
* Include templates from a system path [Mike Pountney] [[cf10f53](https://github.com/Netflix-Skunkworks/go-jira/commit/cf10f53)]
* Added support for the ```expand``` option for Issues [tobyjoe] [[fb4afc9](https://github.com/Netflix-Skunkworks/go-jira/commit/fb4afc9)]
* change for api changes to go-logging [Cory Bennett] [[7bfc6e8](https://github.com/Netflix-Skunkworks/go-jira/commit/7bfc6e8)]
* Fix issuetype calls adding URL escaping [Jonathan Wright] [[e4a25e2](https://github.com/Netflix-Skunkworks/go-jira/commit/e4a25e2)]
<a name="0.0.18"></a>
## [0.0.18] - 2015-12-03
## 0.1.0 - 2016-01-29
<a name="0.0.17"></a>
## [0.0.17] - 2015-12-03
* Fixes [#32](https://github.com/Netflix-Skunkworks/go-jira/issues/32) - make path to cookieFile if it's not present [Mike Pountney] [[6644579](https://github.com/Netflix-Skunkworks/go-jira/commit/6644579)]
* Add component/components support: add and list for now. [Mike Pountney] [[d7b3226](https://github.com/Netflix-Skunkworks/go-jira/commit/d7b3226)]
* Tweak the CmdWatch contract and add watcher remove support [Mike Pountney] [[383847a](https://github.com/Netflix-Skunkworks/go-jira/commit/383847a)]
* Amend vote/unvote to be vote/vote --down [Mike Pountney] [[797edef](https://github.com/Netflix-Skunkworks/go-jira/commit/797edef)]
* Add 'vote' and 'unvote' [Mike Pountney] [[c95e66e](https://github.com/Netflix-Skunkworks/go-jira/commit/c95e66e)]
<a name="0.0.16"></a>
## [0.0.16] - 2015-11-23
## 0.0.20 - 2016-01-21
<a name="0.0.15"></a>
## [0.0.15] - 2015-11-23
* [issue [#28](https://github.com/Netflix-Skunkworks/go-jira/issues/28)] check to make sure we got back issuetypes for create metadata [Cory Bennett] [[ee0e780](https://github.com/Netflix-Skunkworks/go-jira/commit/ee0e780)]
* Add insecure option for TLS endpoints [Brian Lalor] [[6a88bb9](https://github.com/Netflix-Skunkworks/go-jira/commit/6a88bb9)]
* Correct naming of parameter: set/add/remove are actions. [Mike Pountney] [[303784f](https://github.com/Netflix-Skunkworks/go-jira/commit/303784f)]
* Tweak CmdLabels args so that magic happens with CLI [Mike Pountney] [[40a7c65](https://github.com/Netflix-Skunkworks/go-jira/commit/40a7c65)]
* Expose ViewTicket as per FindIssues [Mike Pountney] [[8977f3d](https://github.com/Netflix-Skunkworks/go-jira/commit/8977f3d)]
* Add exposed versions of getTemplate and runTemplate [Mike Pountney] [[da6cbd5](https://github.com/Netflix-Skunkworks/go-jira/commit/da6cbd5)]
* Add 'labels' command to set/add/remove labels [Mike Pountney] [[230b52d](https://github.com/Netflix-Skunkworks/go-jira/commit/230b52d)]
* Add a 'join' func to the template engine [Mike Pountney] [[a7820fe](https://github.com/Netflix-Skunkworks/go-jira/commit/a7820fe)]
* make "jira" golang package, move code from jira/cli to root, move jira/main.go to main/main.go [Cory Bennett] [[7268b9e](https://github.com/Netflix-Skunkworks/go-jira/commit/7268b9e)]
<a name="0.0.14"></a>
## [0.0.14] - 2015-11-17
### Pull Requests
- Merge pull request [#16](https://github.com/go-jira/go-jira/issues/16) from oschrenk/fix-typo
- Merge pull request [#14](https://github.com/go-jira/go-jira/issues/14) from mikepea/ls_with_updated
## 0.0.19 - 2015-12-09
* fix jira trans TRANS ISSUE (case sensitivity issue), also go fmt [Cory Bennett] [[3c30f3b](https://github.com/Netflix-Skunkworks/go-jira/commit/3c30f3b)]
<a name="0.0.13"></a>
## [0.0.13] - 2015-09-19
## 0.0.18 - 2015-12-03
<a name="0.0.12"></a>
## [0.0.12] - 2015-09-18
* need to default "quiet" to false [Cory Bennett] [[4f4a89b](https://github.com/Netflix-Skunkworks/go-jira/commit/4f4a89b)]
<a name="0.0.11"></a>
## [0.0.11] - 2015-09-16
## 0.0.17 - 2015-12-03
<a name="0.0.10"></a>
## [0.0.10] - 2015-09-15
* add --quiet command to not print the OK .. add --saveFile option to print the issue/link to a file on create command [Cory Bennett] [[c9ac162](https://github.com/Netflix-Skunkworks/go-jira/commit/c9ac162)]
* fix overrides [Cory Bennett] [[eaddfe6](https://github.com/Netflix-Skunkworks/go-jira/commit/eaddfe6)]
* add abstract request wrapper to allow you to access/process random apis supported by Jira but not yet supported by go-jira [Cory Bennett] [[90ef56a](https://github.com/Netflix-Skunkworks/go-jira/commit/90ef56a)]
<a name="0.0.9"></a>
## [0.0.9] - 2015-09-15
### Allow "Abort
- [80b6f5a](https://github.com/go-jira/go-jira/commit/80b6f5a198fbe17aa0245c470d47c2988d8624c3): true" to be set while editing to cancel the edit operation
## 0.0.16 - 2015-11-23
<a name="0.0.8"></a>
## [0.0.8] - 2015-07-31
### Pull Requests
- Merge pull request [#11](https://github.com/go-jira/go-jira/issues/11) from mikepea/max_results_option
* jira edit should not require one arguemnt (allow for --query) [Cory Bennett] [[a1eb4a1](https://github.com/Netflix-Skunkworks/go-jira/commit/a1eb4a1)]
### Note
## 0.0.15 - 2015-11-23
that testing against our JIRA instance, in a project with
more than 1000 open issues, suggests that the JIRA has an internal
limit of 1000 results in a single query.
* [[#17](https://github.com/Netflix-Skunkworks/go-jira/issues/17)] print usage on missing arguments [Cory Bennett] [[fd2a2fe](https://github.com/Netflix-Skunkworks/go-jira/commit/fd2a2fe)]
## 0.0.14 - 2015-11-17
<a name="0.0.7"></a>
## [0.0.7] - 2015-07-01
### Merge Branch 'Master' Of Github.Com
- [b72040b](https://github.com/go-jira/go-jira/commit/b72040bfd413bcdc88ca2c3f6843a7f6dee2e898): Netflix-Skunkworks/go-jira
### Pull Requests
- Merge pull request [#9](https://github.com/go-jira/go-jira/issues/9) from nelfin/quickfix/take-user
* s/enpoint/endpoint/g [Oliver Schrenk] [[c5d251d](https://github.com/Netflix-Skunkworks/go-jira/commit/c5d251d)]
* Implement dateFormat template command [Mike Pountney] [[68d3bae](https://github.com/Netflix-Skunkworks/go-jira/commit/68d3bae)]
* Add 'updated' field to default queryfields. [Mike Pountney] [[91e2475](https://github.com/Netflix-Skunkworks/go-jira/commit/91e2475)]
* Fix export-templates option (typo) [Mike Pountney] [[4d7fdb8](https://github.com/Netflix-Skunkworks/go-jira/commit/4d7fdb8)]
* when yaml element resolves to "\n" strip it out so we dont post it to jira [Cory Bennett] [[47ced2f](https://github.com/Netflix-Skunkworks/go-jira/commit/47ced2f)]
* print PUT/POST data when using --dryrun to help debug [Cory Bennett] [[618f245](https://github.com/Netflix-Skunkworks/go-jira/commit/618f245)]
## 0.0.13 - 2015-09-19
<a name="0.0.6"></a>
## [0.0.6] - 2015-02-27
### Set JIRA_OPERATION To "View" When No Operation Used (Ie
- [8040746](https://github.com/go-jira/go-jira/commit/8040746bcf6aac6e3ff6e419c349661a8fc9bf99): jira GOJIRA-123)
* replace dead/deprecated code.google.com/p/gopass with golang.org/x/crypto/ssh/terminal for reading password from stdin [Cory Bennett] [[909eb06](https://github.com/Netflix-Skunkworks/go-jira/commit/909eb06)]
<a name="0.0.5"></a>
## [0.0.5] - 2015-02-21
## 0.0.12 - 2015-09-18
<a name="0.0.4"></a>
## [0.0.4] - 2015-02-19
* fix exception from "jira create" [Cory Bennett] [[9348a4b](https://github.com/Netflix-Skunkworks/go-jira/commit/9348a4b)]
* add some debug messages to help diagnose login failures [Cory Bennett] [[1c08a7d](https://github.com/Netflix-Skunkworks/go-jira/commit/1c08a7d)]
<a name="0.0.3"></a>
## [0.0.3] - 2015-02-19
### [Issue #8] Detect X-Seraph-Loginreason
- [f3feff7](https://github.com/go-jira/go-jira/commit/f3feff796fbecca6477ecbc1e9dae6a2b78e755c): AUTHENTICATION_DENIED header to catch login failures
- [#8](https://github.com/go-jira/go-jira/issues/8)### Pull Requests
- Merge pull request [#7](https://github.com/go-jira/go-jira/issues/7) from jaybuff/empty-projects
## 0.0.11 - 2015-09-16
* add --version [Cory Bennett] [[8385ee2](https://github.com/Netflix-Skunkworks/go-jira/commit/8385ee2)]
* fix command line parser broken in 0.0.10 [Cory Bennett] [[15ae929](https://github.com/Netflix-Skunkworks/go-jira/commit/15ae929)]
## 0.0.10 - 2015-09-15
* allow for command aliasing in conjunction with executable config files. Issue #5 [Cory Bennett] [[23590d4](https://github.com/Netflix-Skunkworks/go-jira/commit/23590d4)]
* update usage [Cory Bennett] [[ef7a57e](https://github.com/Netflix-Skunkworks/go-jira/commit/ef7a57e)]
## 0.0.9 - 2015-09-15
* use forked yaml.v2 so as to not lose line terminations present in jira fields [Cory Bennett] [[f84e77f](https://github.com/Netflix-Skunkworks/go-jira/commit/f84e77f)]
* adding a |~ literal yaml syntax to just chomp a single newline (again to preserve existing formatting in jira fields) [Cory Bennett] [[f84e77f](https://github.com/Netflix-Skunkworks/go-jira/commit/f84e77f)]
* for indent/comment allow for unicode line termination characters that yaml will use for parsing [Cory Bennett] [[f84e77f](https://github.com/Netflix-Skunkworks/go-jira/commit/f84e77f)]
* fix "edit" default option, change how defaults are dealt with for filters [Cory Bennett] [[4265913](https://github.com/Netflix-Skunkworks/go-jira/commit/4265913)]
* for edit template add issue id as comment, also add "comments" as comment so you can review the comment details while editing [Cory Bennett] [[968a9df](https://github.com/Netflix-Skunkworks/go-jira/commit/968a9df)]
* add "comment" template filter to comment out multiline statements [Cory Bennett] [[d664868](https://github.com/Netflix-Skunkworks/go-jira/commit/d664868)]
* add getOpt wrappers to get options with defaults [Cory Bennett] [[c0070cf](https://github.com/Netflix-Skunkworks/go-jira/commit/c0070cf)]
* make --dryrun work [Cory Bennett] [[d229ac1](https://github.com/Netflix-Skunkworks/go-jira/commit/d229ac1)]
* refactor config/option loading so command options override settings in config files [Cory Bennett] [[d229ac1](https://github.com/Netflix-Skunkworks/go-jira/commit/d229ac1)]
* allow query options to be used on the "edit" command to iterate editing [Cory Bennett] [[d229ac1](https://github.com/Netflix-Skunkworks/go-jira/commit/d229ac1)]
* remove duplication for defaults [Cory Bennett] [[f8c8ddf](https://github.com/Netflix-Skunkworks/go-jira/commit/f8c8ddf)]
* use optigo for option parsing, drop docopt [Cory Bennett] [[7bbd571](https://github.com/Netflix-Skunkworks/go-jira/commit/7bbd571)]
* allow "abort: true" to be set while editing to cancel the edit operation [Cory Bennett] [[ea67a77](https://github.com/Netflix-Skunkworks/go-jira/commit/ea67a77)]
* if no changes are made on edit templates then abort edit [Cory Bennett] [[e69b65c](https://github.com/Netflix-Skunkworks/go-jira/commit/e69b65c)]
## 0.0.8 - 2015-07-31
* Add --max_results option for 'ls' [Mike Pountney] [[e06ff0c](https://github.com/Netflix-Skunkworks/go-jira/commit/e06ff0c)]
## 0.0.7 - 2015-07-01
* fix "take" command not honouring user option [Andrew Haigh] [[8f1d2b9](https://github.com/Netflix-Skunkworks/go-jira/commit/8f1d2b9)]
* fix typo [Cory Bennett] [[06f57fe](https://github.com/Netflix-Skunkworks/go-jira/commit/06f57fe)]
## 0.0.6 - 2015-02-27
* allow --sort= to disable sort override [Cory Bennett] [[701f091](https://github.com/Netflix-Skunkworks/go-jira/commit/701f091)]
* fix default JIRA_OPERATION env variable [Cory Bennett] [[82fd9b9](https://github.com/Netflix-Skunkworks/go-jira/commit/82fd9b9)]
* automatically close duplicate issues with "Duplicate" resolution [Cory Bennett] [[ebf1700](https://github.com/Netflix-Skunkworks/go-jira/commit/ebf1700)]
* set JIRA_OPERATION to "view" when no operation used (ie: jira GOJIRA-123) [Cory Bennett] [[050848a](https://github.com/Netflix-Skunkworks/go-jira/commit/050848a)]
* add --sort option to "list" command [Cory Bennett] [[f359030](https://github.com/Netflix-Skunkworks/go-jira/commit/f359030)]
## 0.0.5 - 2015-02-21
* handle editor having arguments [Cory Bennett] [[7186fb3](https://github.com/Netflix-Skunkworks/go-jira/commit/7186fb3)]
* add more template error handling [Cory Bennett] [[3e6f2b3](https://github.com/Netflix-Skunkworks/go-jira/commit/3e6f2b3)]
* allow create template to specify defalt watchers with -o watchers=... [Cory Bennett] [[4db2e4e](https://github.com/Netflix-Skunkworks/go-jira/commit/4db2e4e)]
* if config files are executable then run them and parse the output [Cory Bennett] [[7a2f7f5](https://github.com/Netflix-Skunkworks/go-jira/commit/7a2f7f5)]
## 0.0.4 - 2015-02-19
* add --template option to export-templates to export a single template [Cory Bennett] [[343fbb6](https://github.com/Netflix-Skunkworks/go-jira/commit/343fbb6)]
* add "table" template to be used with "list" command [Cory Bennett] [[8954ec1](https://github.com/Netflix-Skunkworks/go-jira/commit/8954ec1)]
## 0.0.3 - 2015-02-19
* [issue [#8](https://github.com/Netflix-Skunkworks/go-jira/issues/8)] detect X-Seraph-Loginreason: AUTHENTICATION_DENIED header to catch login failures [Cory Bennett] [[2dcf665](https://github.com/Netflix-Skunkworks/go-jira/commit/2dcf665)]
* project should always be uppercase [Jay Buffington] [[1b69d12](https://github.com/Netflix-Skunkworks/go-jira/commit/1b69d12)]
* if response is 400, check json for errorMessages and log them [Jay Buffington] [[4924dfa](https://github.com/Netflix-Skunkworks/go-jira/commit/4924dfa)]
* validate project [Jay Buffington] [[dc5ae42](https://github.com/Netflix-Skunkworks/go-jira/commit/dc5ae42)]
## 0.0.2 - 2015-02-18
* add missing --override options on transition command
* add browse command
<a name="0.0.2"></a>
## [0.0.2] - 2015-02-18
<a name="0.0.1"></a>
## 0.0.1 - 2015-02-18
### Adding Commands
- [18f10fd](https://github.com/go-jira/go-jira/commit/18f10fd12521584c7d85b20dff2b1c2da0854cb9): * create * dups * blocks * watch
### Merge Branch 'Nil-Assignee' Of Https
- [25539ef](https://github.com/go-jira/go-jira/commit/25539efedda0e06e103fc942e16405c0c09ba621): //github.com/jaybuff/go-jira into jaybuff-nil-assignee
### Work In Progress, Minor Refactor. Added Commands
- [acbc24b](https://github.com/go-jira/go-jira/commit/acbc24b2096f31a5805fa48984724a4a6c1da431): * login * editmeta ISSUE * edit ISSUE * issuetypes [-p PROJECT] * createmeta [-p PROJECT] [-i ISSUETYPE] * transitions ISSUE
### Pull Requests
- Merge pull request [#2](https://github.com/go-jira/go-jira/issues/2) from jaybuff/clean-up
* Initial experimental release
[Unreleased]: https://github.com/go-jira/go-jira/compare/v1.0.28...HEAD
[v1.0.28]: https://github.com/go-jira/go-jira/compare/v1.0.27...v1.0.28
[v1.0.27]: https://github.com/go-jira/go-jira/compare/v1.0.26...v1.0.27
[v1.0.26]: https://github.com/go-jira/go-jira/compare/v1.0.25...v1.0.26
[v1.0.25]: https://github.com/go-jira/go-jira/compare/v1.0.24...v1.0.25
[v1.0.24]: https://github.com/go-jira/go-jira/compare/v1.0.23...v1.0.24
[v1.0.23]: https://github.com/go-jira/go-jira/compare/v1.0.22...v1.0.23
[v1.0.22]: https://github.com/go-jira/go-jira/compare/v1.0.21...v1.0.22
[v1.0.21]: https://github.com/go-jira/go-jira/compare/v1.0.20...v1.0.21
[v1.0.20]: https://github.com/go-jira/go-jira/compare/v1.0.19...v1.0.20
[v1.0.19]: https://github.com/go-jira/go-jira/compare/v1.0.18...v1.0.19
[v1.0.18]: https://github.com/go-jira/go-jira/compare/v1.0.17...v1.0.18
[v1.0.17]: https://github.com/go-jira/go-jira/compare/v1.0.16...v1.0.17
[v1.0.16]: https://github.com/go-jira/go-jira/compare/v1.0.15...v1.0.16
[v1.0.15]: https://github.com/go-jira/go-jira/compare/v1.0.14...v1.0.15
[v1.0.14]: https://github.com/go-jira/go-jira/compare/v1.0.13...v1.0.14
[v1.0.13]: https://github.com/go-jira/go-jira/compare/v1.0.12...v1.0.13
[v1.0.12]: https://github.com/go-jira/go-jira/compare/v1.0.11...v1.0.12
[v1.0.11]: https://github.com/go-jira/go-jira/compare/v1.0.10...v1.0.11
[v1.0.10]: https://github.com/go-jira/go-jira/compare/v1.0.9...v1.0.10
[v1.0.9]: https://github.com/go-jira/go-jira/compare/v1.0.8...v1.0.9
[v1.0.8]: https://github.com/go-jira/go-jira/compare/v1.0.7...v1.0.8
[v1.0.7]: https://github.com/go-jira/go-jira/compare/v1.0.6...v1.0.7
[v1.0.6]: https://github.com/go-jira/go-jira/compare/v1.0.5...v1.0.6
[v1.0.5]: https://github.com/go-jira/go-jira/compare/v1.0.4...v1.0.5
[v1.0.4]: https://github.com/go-jira/go-jira/compare/v1.0.3...v1.0.4
[v1.0.3]: https://github.com/go-jira/go-jira/compare/v1.0.2...v1.0.3
[v1.0.2]: https://github.com/go-jira/go-jira/compare/v1.0.1...v1.0.2
[v1.0.1]: https://github.com/go-jira/go-jira/compare/v1.0.0...v1.0.1
[v1.0.0]: https://github.com/go-jira/go-jira/compare/v0.1.15...v1.0.0
[v0.1.15]: https://github.com/go-jira/go-jira/compare/v0.1.14...v0.1.15
[v0.1.14]: https://github.com/go-jira/go-jira/compare/v0.1.13...v0.1.14
[v0.1.13]: https://github.com/go-jira/go-jira/compare/v0.1.12...v0.1.13
[v0.1.12]: https://github.com/go-jira/go-jira/compare/v0.1.11...v0.1.12
[v0.1.11]: https://github.com/go-jira/go-jira/compare/v0.1.10...v0.1.11
[v0.1.10]: https://github.com/go-jira/go-jira/compare/v0.1.9...v0.1.10
[v0.1.9]: https://github.com/go-jira/go-jira/compare/v0.1.8...v0.1.9
[v0.1.8]: https://github.com/go-jira/go-jira/compare/v0.1.7...v0.1.8
[v0.1.7]: https://github.com/go-jira/go-jira/compare/v0.1.6...v0.1.7
[v0.1.6]: https://github.com/go-jira/go-jira/compare/v0.1.5...v0.1.6
[v0.1.5]: https://github.com/go-jira/go-jira/compare/v0.1.4...v0.1.5
[v0.1.4]: https://github.com/go-jira/go-jira/compare/v0.1.3...v0.1.4
[v0.1.3]: https://github.com/go-jira/go-jira/compare/v0.1.2...v0.1.3
[v0.1.2]: https://github.com/go-jira/go-jira/compare/v0.1.1...v0.1.2
[v0.1.1]: https://github.com/go-jira/go-jira/compare/v0.1.0...v0.1.1
[v0.1.0]: https://github.com/go-jira/go-jira/compare/v0.0.20...v0.1.0
[v0.0.20]: https://github.com/go-jira/go-jira/compare/0.0.19...v0.0.20
[0.0.19]: https://github.com/go-jira/go-jira/compare/0.0.18...0.0.19
[0.0.18]: https://github.com/go-jira/go-jira/compare/0.0.17...0.0.18
[0.0.17]: https://github.com/go-jira/go-jira/compare/0.0.16...0.0.17
[0.0.16]: https://github.com/go-jira/go-jira/compare/0.0.15...0.0.16
[0.0.15]: https://github.com/go-jira/go-jira/compare/0.0.14...0.0.15
[0.0.14]: https://github.com/go-jira/go-jira/compare/0.0.13...0.0.14
[0.0.13]: https://github.com/go-jira/go-jira/compare/0.0.12...0.0.13
[0.0.12]: https://github.com/go-jira/go-jira/compare/0.0.11...0.0.12
[0.0.11]: https://github.com/go-jira/go-jira/compare/0.0.10...0.0.11
[0.0.10]: https://github.com/go-jira/go-jira/compare/0.0.9...0.0.10
[0.0.9]: https://github.com/go-jira/go-jira/compare/0.0.8...0.0.9
[0.0.8]: https://github.com/go-jira/go-jira/compare/0.0.7...0.0.8
[0.0.7]: https://github.com/go-jira/go-jira/compare/0.0.6...0.0.7
[0.0.6]: https://github.com/go-jira/go-jira/compare/0.0.5...0.0.6
[0.0.5]: https://github.com/go-jira/go-jira/compare/0.0.4...0.0.5
[0.0.4]: https://github.com/go-jira/go-jira/compare/0.0.3...0.0.4
[0.0.3]: https://github.com/go-jira/go-jira/compare/0.0.2...0.0.3
[0.0.2]: https://github.com/go-jira/go-jira/compare/0.0.1...0.0.2
+492
View File
@@ -0,0 +1,492 @@
# Changelog
## 1.0.25 - 2020-09-11
* Ensure body is NPE safe [Louis DeLosSantos] [[42e5d23](https://github.com/Netflix-Skunkworks/go-jira/commit/42e5d23)]
* Support empty responses in request commands [Louis DeLosSantos] [[b572037](https://github.com/Netflix-Skunkworks/go-jira/commit/b572037)]
## 1.0.24 - 2020-09-04
* Make -h flag show --help [Benjamin Kane] [[4bf1d03](https://github.com/Netflix-Skunkworks/go-jira/commit/4bf1d03)]
* transition: map field name to id [Louis DeLosSantos] [[3c1c4d9](https://github.com/Netflix-Skunkworks/go-jira/commit/3c1c4d9)]
* username-deprecation: use email and display names [Louis DeLosSantos] [[6a27e28](https://github.com/Netflix-Skunkworks/go-jira/commit/6a27e28)]
* Add support to get all comments for an issue [Thibault Jamet] [[a311d0d](https://github.com/Netflix-Skunkworks/go-jira/commit/a311d0d)]
* update all usage of user.name to user.accountId for privacy migration: https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/ [Cory Bennett] [[a26683e](https://github.com/Netflix-Skunkworks/go-jira/commit/a26683e)]
* add template functions to handle table output, fixes [#176](https://github.com/Netflix-Skunkworks/go-jira/issues/176), replaces [#296](https://github.com/Netflix-Skunkworks/go-jira/issues/296) [Cory Bennett] [[7e97463](https://github.com/Netflix-Skunkworks/go-jira/commit/7e97463)]
* use `password-source-path` to allow overriding binary and/or path to binary [Cory Bennett] [[d6173ce](https://github.com/Netflix-Skunkworks/go-jira/commit/d6173ce)]
* allow issues on command line to automatically prefix with project when defined [Cory Bennett] [[d002d7f](https://github.com/Netflix-Skunkworks/go-jira/commit/d002d7f)]
* Forgot you use TAB instead of spaces [Cory Bennett] [[789886c](https://github.com/Netflix-Skunkworks/go-jira/commit/789886c)]
* Fixed append project to view [Cory Bennett] [[8a46215](https://github.com/Netflix-Skunkworks/go-jira/commit/8a46215)]
* Added a line break removal function [Cory Bennett] [[9cbd993](https://github.com/Netflix-Skunkworks/go-jira/commit/9cbd993)]
* Pushed Readfile to .jira.d directory instead of pwd [Cory Bennett] [[db53622](https://github.com/Netflix-Skunkworks/go-jira/commit/db53622)]
* Cache password to avoid invoking password source on each API request [Patrick Decat] [[0f059a5](https://github.com/Netflix-Skunkworks/go-jira/commit/0f059a5)]
* Add support to switch out password source binary [Patrick Pichler] [[659a5c8](https://github.com/Netflix-Skunkworks/go-jira/commit/659a5c8)]
* Add error handling to pass password-source [Patrick Pichler] [[3339303](https://github.com/Netflix-Skunkworks/go-jira/commit/3339303)]
* Add gopass support [Patrick Pichler] [[3c0a62e](https://github.com/Netflix-Skunkworks/go-jira/commit/3c0a62e)]
* add sprig template functions, replaces [[#215](https://github.com/Netflix-Skunkworks/go-jira/issues/215)] http://masterminds.github.io/sprig/ [Cory Bennett] [[719f7a6](https://github.com/Netflix-Skunkworks/go-jira/commit/719f7a6)]
* [[#232](https://github.com/Netflix-Skunkworks/go-jira/issues/232)] fix api to use common Version schema also rewrote the schema fetcher to use Go [Cory Bennett] [[90f01ce](https://github.com/Netflix-Skunkworks/go-jira/commit/90f01ce)]
* fix syntax [Cory Bennett] [[94dd489](https://github.com/Netflix-Skunkworks/go-jira/commit/94dd489)]
* Address comments for direct name match [Patrick Cockwell] [[a70384b](https://github.com/Netflix-Skunkworks/go-jira/commit/a70384b)]
* Choose exact transition match if available [Patrick Cockwell] [[a646f76](https://github.com/Netflix-Skunkworks/go-jira/commit/a646f76)]
* [[#277](https://github.com/Netflix-Skunkworks/go-jira/issues/277)] update figtree to latest [Cory Bennett] [[0e520a4](https://github.com/Netflix-Skunkworks/go-jira/commit/0e520a4)]
* Switch over to using github.com/go-jira/jira, from gopkg.in [Mike Pountney] [[27f57b2](https://github.com/Netflix-Skunkworks/go-jira/commit/27f57b2)]
* Add 'pctOf' and 'fit' template functions [Adriano Caloiaro] [[027adee](https://github.com/Netflix-Skunkworks/go-jira/commit/027adee)]
* fix worklog template to allow multiline comments [Matthias Bethke] [[43e07f1](https://github.com/Netflix-Skunkworks/go-jira/commit/43e07f1)]
* Allow reading password from stdin [Justin Ko] [[225e1dc](https://github.com/Netflix-Skunkworks/go-jira/commit/225e1dc)]
* all: unindent some code [Daniel Martí] [[31c113d](https://github.com/Netflix-Skunkworks/go-jira/commit/31c113d)]
* don't use ReadAll when decoding JSON [Daniel Martí] [[9bcdcc1](https://github.com/Netflix-Skunkworks/go-jira/commit/9bcdcc1)]
* start making staticcheck happier [Daniel Martí] [[9b9186f](https://github.com/Netflix-Skunkworks/go-jira/commit/9b9186f)]
* all: convert to a Go module [Daniel Martí] [[f125ef3](https://github.com/Netflix-Skunkworks/go-jira/commit/f125ef3)]
* CI: test on Go 1.12.x, cleanup [Daniel Martí] [[664c5ca](https://github.com/Netflix-Skunkworks/go-jira/commit/664c5ca)]
* make automatic pagination on search optional, fix tests [Cory Bennett] [[36c99ce](https://github.com/Netflix-Skunkworks/go-jira/commit/36c99ce)]
* prefer defer resp.Body.Close to avoid leaks on subsequent errors [Cory Bennett] [[181bd74](https://github.com/Netflix-Skunkworks/go-jira/commit/181bd74)]
* add pagination to search [Miles Maddox] [[76dd1d8](https://github.com/Netflix-Skunkworks/go-jira/commit/76dd1d8)]
* Fix function comments based on best practices from Effective Go [CodeLingo Bot] [[23ac118](https://github.com/Netflix-Skunkworks/go-jira/commit/23ac118)]
## 1.0.23 - 2020-02-26
* update all usage of user.name to user.accountId for privacy migration: https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/ [Cory Bennett] [[a26683e](https://github.com/Netflix-Skunkworks/go-jira/commit/a26683e)]
* add template functions to handle table output, fixes [#176](https://github.com/Netflix-Skunkworks/go-jira/issues/176), replaces [#296](https://github.com/Netflix-Skunkworks/go-jira/issues/296) [Cory Bennett] [[7e97463](https://github.com/Netflix-Skunkworks/go-jira/commit/7e97463)]
* use `password-source-path` to allow overriding binary and/or path to binary [Cory Bennett] [[d6173ce](https://github.com/Netflix-Skunkworks/go-jira/commit/d6173ce)]
* allow issues on command line to automatically prefix with project when defined [Cory Bennett] [[d002d7f](https://github.com/Netflix-Skunkworks/go-jira/commit/d002d7f)]
* Forgot you use TAB instead of spaces [Cory Bennett] [[789886c](https://github.com/Netflix-Skunkworks/go-jira/commit/789886c)]
* Fixed append project to view [Cory Bennett] [[8a46215](https://github.com/Netflix-Skunkworks/go-jira/commit/8a46215)]
* Added a line break removal function [Cory Bennett] [[9cbd993](https://github.com/Netflix-Skunkworks/go-jira/commit/9cbd993)]
* Pushed Readfile to .jira.d directory instead of pwd [Cory Bennett] [[db53622](https://github.com/Netflix-Skunkworks/go-jira/commit/db53622)]
* Cache password to avoid invoking password source on each API request [Patrick Decat] [[0f059a5](https://github.com/Netflix-Skunkworks/go-jira/commit/0f059a5)]
* Add support to switch out password source binary [Patrick Pichler] [[659a5c8](https://github.com/Netflix-Skunkworks/go-jira/commit/659a5c8)]
* Add error handling to pass password-source [Patrick Pichler] [[3339303](https://github.com/Netflix-Skunkworks/go-jira/commit/3339303)]
* Add gopass support [Patrick Pichler] [[3c0a62e](https://github.com/Netflix-Skunkworks/go-jira/commit/3c0a62e)]
* add sprig template functions, replaces [[#215](https://github.com/Netflix-Skunkworks/go-jira/issues/215)] http://masterminds.github.io/sprig/ [Cory Bennett] [[719f7a6](https://github.com/Netflix-Skunkworks/go-jira/commit/719f7a6)]
* [[#232](https://github.com/Netflix-Skunkworks/go-jira/issues/232)] fix api to use common Version schema also rewrote the schema fetcher to use Go [Cory Bennett] [[90f01ce](https://github.com/Netflix-Skunkworks/go-jira/commit/90f01ce)]
## 1.0.22 - 2019-09-30
* fix syntax [Cory Bennett] [[807ca76](https://github.com/Netflix-Skunkworks/go-jira/commit/807ca76)]
* Address comments for direct name match [Patrick Cockwell] [[a70384b](https://github.com/Netflix-Skunkworks/go-jira/commit/a70384b)]
* Choose exact transition match if available [Patrick Cockwell] [[a646f76](https://github.com/Netflix-Skunkworks/go-jira/commit/a646f76)]
## 1.0.21 - 2019-09-16
* [[#277](https://github.com/Netflix-Skunkworks/go-jira/issues/277)] update figtree to latest [Cory Bennett] [[0e520a4](https://github.com/Netflix-Skunkworks/go-jira/commit/0e520a4)]
* Switch over to using github.com/go-jira/jira, from gopkg.in [Mike Pountney] [[27f57b2](https://github.com/Netflix-Skunkworks/go-jira/commit/27f57b2)]
* fix worklog template to allow multiline comments [Matthias Bethke] [[43e07f1](https://github.com/Netflix-Skunkworks/go-jira/commit/43e07f1)]
* Allow reading password from stdin [Justin Ko] [[225e1dc](https://github.com/Netflix-Skunkworks/go-jira/commit/225e1dc)]
* all: unindent some code [Daniel Martí] [[31c113d](https://github.com/Netflix-Skunkworks/go-jira/commit/31c113d)]
* don't use ReadAll when decoding JSON [Daniel Martí] [[9bcdcc1](https://github.com/Netflix-Skunkworks/go-jira/commit/9bcdcc1)]
* start making staticcheck happier [Daniel Martí] [[9b9186f](https://github.com/Netflix-Skunkworks/go-jira/commit/9b9186f)]
* all: convert to a Go module [Daniel Martí] [[f125ef3](https://github.com/Netflix-Skunkworks/go-jira/commit/f125ef3)]
* CI: test on Go 1.12.x, cleanup [Daniel Martí] [[664c5ca](https://github.com/Netflix-Skunkworks/go-jira/commit/664c5ca)]
* make automatic pagination on search optional, fix tests [Cory Bennett] [[36c99ce](https://github.com/Netflix-Skunkworks/go-jira/commit/36c99ce)]
* prefer defer resp.Body.Close to avoid leaks on subsequent errors [Cory Bennett] [[181bd74](https://github.com/Netflix-Skunkworks/go-jira/commit/181bd74)]
* add pagination to search [Miles Maddox] [[76dd1d8](https://github.com/Netflix-Skunkworks/go-jira/commit/76dd1d8)]
* Fix function comments based on best practices from Effective Go [CodeLingo Bot] [[23ac118](https://github.com/Netflix-Skunkworks/go-jira/commit/23ac118)]
* [[#201](https://github.com/Netflix-Skunkworks/go-jira/issues/201)] update required library, failing to populate cookiejar from cookies file [Cory Bennett] [[ee69afa](https://github.com/Netflix-Skunkworks/go-jira/commit/ee69afa)]
## 1.0.20 - 2018-08-04
* [[#201](https://github.com/Netflix-Skunkworks/go-jira/issues/201)] update required library, failing to populate cookiejar from cookies file [Cory Bennett] [[ee69afa](https://github.com/Netflix-Skunkworks/go-jira/commit/ee69afa)]
## 1.0.19 - 2018-08-02
* [[#199](https://github.com/Netflix-Skunkworks/go-jira/issues/199)] [[#198](https://github.com/Netflix-Skunkworks/go-jira/issues/198)] update http client library, fix issues with internal login retries [Cory Bennett] [[0cba806](https://github.com/Netflix-Skunkworks/go-jira/commit/0cba806)]
## 1.0.18 - 2018-07-29
* [[#196](https://github.com/Netflix-Skunkworks/go-jira/issues/196)] add `jira session` command to show session information if user is authenticated [Cory Bennett] [[f592107](https://github.com/Netflix-Skunkworks/go-jira/commit/f592107)]
* [[#192](https://github.com/Netflix-Skunkworks/go-jira/issues/192)] fix template usage for 'fixVersions' in transition template [Cory Bennett] [[c9a4e30](https://github.com/Netflix-Skunkworks/go-jira/commit/c9a4e30)]
* move HandleExit to the jiracli package [Cory Bennett] [[ef9b731](https://github.com/Netflix-Skunkworks/go-jira/commit/ef9b731)]
* they broke golang.org/x/net: ERROR: vendor/golang.org/x/net/proxy/socks5.go:11:2: use of internal package not allowed [Cory Bennett] [[7191c77](https://github.com/Netflix-Skunkworks/go-jira/commit/7191c77)]
* udpate deps [Cory Bennett] [[d16bcc2](https://github.com/Netflix-Skunkworks/go-jira/commit/d16bcc2)]
* udpate for figtree api changes [Cory Bennett] [[07ba74b](https://github.com/Netflix-Skunkworks/go-jira/commit/07ba74b)]
* udpate to use latest dep, update figtree [Cory Bennett] [[462ef1c](https://github.com/Netflix-Skunkworks/go-jira/commit/462ef1c)]
* [[#171](https://github.com/Netflix-Skunkworks/go-jira/issues/171)] change proposed PasswordPath to PasswordName [Cory Bennett] [[213a7e0](https://github.com/Netflix-Skunkworks/go-jira/commit/213a7e0)]
* add pass path to config [dvogt23] [[fa01ff5](https://github.com/Netflix-Skunkworks/go-jira/commit/fa01ff5)]
## 1.0.17 - 2018-04-15
* fix IsTerminal usage for windows [Cory Bennett] [[7f9595c](https://github.com/Netflix-Skunkworks/go-jira/commit/7f9595c)]
* [[#166](https://github.com/Netflix-Skunkworks/go-jira/issues/166)] fix issue when editing templates specified with full path [Cory Bennett] [[d787ac0](https://github.com/Netflix-Skunkworks/go-jira/commit/d787ac0)]
* only prompt on logout if stdin and stdout are terminals [Cory Bennett] [[09a61c3](https://github.com/Netflix-Skunkworks/go-jira/commit/09a61c3)]
* [[#163](https://github.com/Netflix-Skunkworks/go-jira/issues/163)] fix url path join logic [Cory Bennett] [[9146346](https://github.com/Netflix-Skunkworks/go-jira/commit/9146346)]
* [[#160](https://github.com/Netflix-Skunkworks/go-jira/issues/160)] prompt when api-token is invalid to get new token [Cory Bennett] [[e639cce](https://github.com/Netflix-Skunkworks/go-jira/commit/e639cce)]
* [[#157](https://github.com/Netflix-Skunkworks/go-jira/issues/157)] add `password-directory: path` to allow overriding PASSWORD_STORE_DIR from configs [Cory Bennett] [[06b26c9](https://github.com/Netflix-Skunkworks/go-jira/commit/06b26c9)]
* [[#160](https://github.com/Netflix-Skunkworks/go-jira/issues/160)] allow `jira logout` to delete your api-token from keychain [Cory Bennett] [[bd3cf99](https://github.com/Netflix-Skunkworks/go-jira/commit/bd3cf99)]
## 1.0.16 - 2018-04-01
* [[#159](https://github.com/Netflix-Skunkworks/go-jira/issues/159)] fix `slice bounds out of range` error in `abbrev` template function [Cory Bennett] [[359bec2](https://github.com/Netflix-Skunkworks/go-jira/commit/359bec2)]
* [[#158](https://github.com/Netflix-Skunkworks/go-jira/issues/158)] always print usage to stdout [Cory Bennett] [[79c83f6](https://github.com/Netflix-Skunkworks/go-jira/commit/79c83f6)]
## 1.0.15 - 2018-03-08
* [[#147](https://github.com/Netflix-Skunkworks/go-jira/issues/147)] [[#148](https://github.com/Netflix-Skunkworks/go-jira/issues/148)] add support for api token based authentication [Cory Bennett] [[edb0662](https://github.com/Netflix-Skunkworks/go-jira/commit/edb0662)]
* refactor to simplify main [Cory Bennett] [[43ebc84](https://github.com/Netflix-Skunkworks/go-jira/commit/43ebc84)] [[0d7c1a7](https://github.com/Netflix-Skunkworks/go-jira/commit/0d7c1a7)]
* [[#145](https://github.com/Netflix-Skunkworks/go-jira/issues/145)] fix to match AuthProvider interface [Cory Bennett] [[80325a5](https://github.com/Netflix-Skunkworks/go-jira/commit/80325a5)]
* [[#141](https://github.com/Netflix-Skunkworks/go-jira/issues/141)] better handling in responseError for non-json error responses [Cory Bennett] [[20a9666](https://github.com/Netflix-Skunkworks/go-jira/commit/20a9666)]
* Update unexportTemplates.go [GitHub] [[6da9974](https://github.com/Netflix-Skunkworks/go-jira/commit/6da9974)]
* [[#139](https://github.com/Netflix-Skunkworks/go-jira/issues/139)] add shellquote and toMinJson template functions [Cory Bennett] [[8c7ca38](https://github.com/Netflix-Skunkworks/go-jira/commit/8c7ca38)]
* [[#137](https://github.com/Netflix-Skunkworks/go-jira/issues/137)] update kingpeon dep to allow access to dynamic command structure [Cory Bennett] [[425fa63](https://github.com/Netflix-Skunkworks/go-jira/commit/425fa63)]
* field name is "comment" not "comments" [Cory Bennett] [[464742c](https://github.com/Netflix-Skunkworks/go-jira/commit/464742c)]
## 1.0.14 - 2017-11-04
* [[#131](https://github.com/Netflix-Skunkworks/go-jira/issues/131)] fix parsing global options before command execution (allow unixproxy/socksproxy to be set in config.yml) [Cory Bennett] [[042bc48](https://github.com/Netflix-Skunkworks/go-jira/commit/042bc48)]
* add/update deps [Cory Bennett] [[a2e36e8](https://github.com/Netflix-Skunkworks/go-jira/commit/a2e36e8)]
* add support for using socks proxy [onionjake] [[ff985f9](https://github.com/Netflix-Skunkworks/go-jira/commit/ff985f9)]
## 1.0.13 - 2017-10-28
* fix transition command [Cory Bennett] [[9597f9b](https://github.com/Netflix-Skunkworks/go-jira/commit/9597f9b)]
* fix default values to load after parsing configs [Cory Bennett] [[c9b5054](https://github.com/Netflix-Skunkworks/go-jira/commit/c9b5054)]
* add test to make sure IssueType.Fields does not disappear on regeneration [Cory Bennett] [[3966def](https://github.com/Netflix-Skunkworks/go-jira/commit/3966def)]
* add tests for validating changes to auto-generated jiradata files [Cory Bennett] [[41d1a7c](https://github.com/Netflix-Skunkworks/go-jira/commit/41d1a7c)]
* Fix typo in 'logout' command help [Cory Bennett] [[9000777](https://github.com/Netflix-Skunkworks/go-jira/commit/9000777)]
* Add URL escaping to an additional issuetype call [Cory Bennett] [[7bfa241](https://github.com/Netflix-Skunkworks/go-jira/commit/7bfa241)]
* Add --resolution option [Cory Bennett] [[e6600cf](https://github.com/Netflix-Skunkworks/go-jira/commit/e6600cf)]
* Create Metadata Not Populated Correctly [Dillon Buchanan] [[093c510](https://github.com/Netflix-Skunkworks/go-jira/commit/093c510)]
* add regexReplace template function [Dirk Heilig] [[d3e294e](https://github.com/Netflix-Skunkworks/go-jira/commit/d3e294e)]
## 1.0.12 - 2017-10-04
* add `{{env.VARNAME}}` template support to allow use of env vars [Cory Bennett] [[4d74554](https://github.com/Netflix-Skunkworks/go-jira/commit/4d74554)]
## 1.0.11 - 2017-09-26
* [[#115](https://github.com/Netflix-Skunkworks/go-jira/issues/115)] fix transition template for description [Cory Bennett] [[986cc78](https://github.com/Netflix-Skunkworks/go-jira/commit/986cc78)]
* update edit command to set queryFields on search to match what is used in template [Cory Bennett] [[3913726](https://github.com/Netflix-Skunkworks/go-jira/commit/3913726)]
* fix edit with query loop, allow continuation when not submitting previous issue [Cory Bennett] [[0ba8aa0](https://github.com/Netflix-Skunkworks/go-jira/commit/0ba8aa0)]
* fix edit when priority is not set [Cory Bennett] [[098eb99](https://github.com/Netflix-Skunkworks/go-jira/commit/098eb99)]
* flatten CommandRegistry list to make it more readable [Cory Bennett] [[2ddaed2](https://github.com/Netflix-Skunkworks/go-jira/commit/2ddaed2)]
## 1.0.10 - 2017-09-18
* clean up usage formatting, print aliases [Cory Bennett] [[9f433ac](https://github.com/Netflix-Skunkworks/go-jira/commit/9f433ac)]
* fix edit [Cory Bennett] [[4c6b36c](https://github.com/Netflix-Skunkworks/go-jira/commit/4c6b36c)]
* fix named query template expansion [Cory Bennett] [[a8eaa97](https://github.com/Netflix-Skunkworks/go-jira/commit/a8eaa97)]
* fix usage message [Cory Bennett] [[cd3cfd8](https://github.com/Netflix-Skunkworks/go-jira/commit/cd3cfd8)]
## 1.0.9 - 2017-09-17
* need issuetype to use the default list table template now [Cory Bennett] [[3e8b9bd](https://github.com/Netflix-Skunkworks/go-jira/commit/3e8b9bd)]
* [[#102](https://github.com/Netflix-Skunkworks/go-jira/issues/102)] add issuetype into the default queryfields and add it to the default `table` list template [Cory Bennett] [[c9d8dfb](https://github.com/Netflix-Skunkworks/go-jira/commit/c9d8dfb)]
## 1.0.8 - 2017-09-17
* [[#100](https://github.com/Netflix-Skunkworks/go-jira/issues/100)] add support for posting, fetching, listing and removing attachments [Cory Bennett] [[66eb7bf](https://github.com/Netflix-Skunkworks/go-jira/commit/66eb7bf)]
## 1.0.7 - 2017-09-15
* [[#87](https://github.com/Netflix-Skunkworks/go-jira/issues/87)] add various commands for interacting with epics [Cory Bennett] [[893454f](https://github.com/Netflix-Skunkworks/go-jira/commit/893454f)]
## 1.0.6 - 2017-09-13
* tweaks for templates in named queries to work better [Cory Bennett] [[00cba79](https://github.com/Netflix-Skunkworks/go-jira/commit/00cba79)]
* [[#99](https://github.com/Netflix-Skunkworks/go-jira/issues/99)] add support for named queries to be stored in configs [Cory Bennett] [[fb43753](https://github.com/Netflix-Skunkworks/go-jira/commit/fb43753)]
* [[#98](https://github.com/Netflix-Skunkworks/go-jira/issues/98)] add `--status` option for JQL filter on status with `list` command [Cory Bennett] [[5da04c1](https://github.com/Netflix-Skunkworks/go-jira/commit/5da04c1)]
## 1.0.5 - 2017-09-11
* use --gjq for GJson Query to filter json response data [Cory Bennett] [[608e586](https://github.com/Netflix-Skunkworks/go-jira/commit/608e586)]
* fix field tag syntax [Cory Bennett] [[2c552ac](https://github.com/Netflix-Skunkworks/go-jira/commit/2c552ac)]
* add '{{jira}}' template macro to refer to path of currently running jira command [Cory Bennett] [[941824d](https://github.com/Netflix-Skunkworks/go-jira/commit/941824d)]
## 1.0.4 - 2017-09-08
* update deps for kingpeon update use os.exec instead of syscall.exec for windows [Cory Bennett] [[86b963b](https://github.com/Netflix-Skunkworks/go-jira/commit/86b963b)]
## 1.0.3 - 2017-09-06
* [[#66](https://github.com/Netflix-Skunkworks/go-jira/issues/66)] add --started option to `jira worklog add` to change the start time for worklog [Cory Bennett] [[e6faee1](https://github.com/Netflix-Skunkworks/go-jira/commit/e6faee1)]
* [[#45](https://github.com/Netflix-Skunkworks/go-jira/issues/45)] automatically add comment to issue even if transition does not support comment updates during transtion [Cory Bennett] [[c4be59c](https://github.com/Netflix-Skunkworks/go-jira/commit/c4be59c)]
## 1.0.2 - 2017-09-06
* update dependencies [Cory Bennett] [[aa876cd](https://github.com/Netflix-Skunkworks/go-jira/commit/aa876cd)]
* update for github.com/AlecAivazis/survey => gopkg.in/AlecAivazis/survey.v1 package [Cory Bennett] [[9453179](https://github.com/Netflix-Skunkworks/go-jira/commit/9453179)]
* use stdout to determin output terminal size [Cory Bennett] [[4d79af4](https://github.com/Netflix-Skunkworks/go-jira/commit/4d79af4)]
## 1.0.1 - 2017-09-06
* [[#13](https://github.com/Netflix-Skunkworks/go-jira/issues/13)] change default input syntax to not require escaping for special characters [Cory Bennett] [[1106558](https://github.com/Netflix-Skunkworks/go-jira/commit/1106558)]
## 1.0.0 - 2017-09-05
* fix build for windows [Cory Bennett] [[1b854da](https://github.com/Netflix-Skunkworks/go-jira/commit/1b854da)]
* change the default log output format [Cory Bennett] [[f1b8c64](https://github.com/Netflix-Skunkworks/go-jira/commit/f1b8c64)]
* tweak auto-login so it does not print the standard `jira login` command output [Cory Bennett] [[49f6cdc](https://github.com/Netflix-Skunkworks/go-jira/commit/49f6cdc)]
* add --quiet global option [Cory Bennett] [[c226077](https://github.com/Netflix-Skunkworks/go-jira/commit/c226077)]
* refactor to allow for --insecure and --unixproxy arguments [Cory Bennett] [[c0358eb](https://github.com/Netflix-Skunkworks/go-jira/commit/c0358eb)]
* handle html response on expired cookies (require X-Ausername header to always be present) [Cory Bennett] [[21920c5](https://github.com/Netflix-Skunkworks/go-jira/commit/21920c5)]
* allow login prompt to be interrupted [Cory Bennett] [[7ab6c22](https://github.com/Netflix-Skunkworks/go-jira/commit/7ab6c22)]
* fmt -> log typo [Cory Bennett] [[bccf09f](https://github.com/Netflix-Skunkworks/go-jira/commit/bccf09f)]
* make ~/.jira.d directory if not already present [Cory Bennett] [[e72479c](https://github.com/Netflix-Skunkworks/go-jira/commit/e72479c)]
* fix go vet [Cory Bennett] [[e04b506](https://github.com/Netflix-Skunkworks/go-jira/commit/e04b506)]
* fix tests [Cory Bennett] [[ba35f55](https://github.com/Netflix-Skunkworks/go-jira/commit/ba35f55)]
* add OK printf [Cory Bennett] [[dc02181](https://github.com/Netflix-Skunkworks/go-jira/commit/dc02181)]
* change --method to use -M for backwards compat [Cory Bennett] [[b120c0b](https://github.com/Netflix-Skunkworks/go-jira/commit/b120c0b)]
* add resolution to dup'd issues when necessary [Cory Bennett] [[2638396](https://github.com/Netflix-Skunkworks/go-jira/commit/2638396)]
* call correct function for `labels remove|set` commands [Cory Bennett] [[ad1a62a](https://github.com/Netflix-Skunkworks/go-jira/commit/ad1a62a)]
* data argument is optional (for GET and DELETE requests) [Cory Bennett] [[4b60313](https://github.com/Netflix-Skunkworks/go-jira/commit/4b60313)]
* fix usage, overrides not serialized correctly [Cory Bennett] [[84119a2](https://github.com/Netflix-Skunkworks/go-jira/commit/84119a2)]
* fix `jira ISSUE-123` command line parsing [Cory Bennett] [[fa4ac25](https://github.com/Netflix-Skunkworks/go-jira/commit/fa4ac25)]
* add logger object to jiracmd [Cory Bennett] [[aed952b](https://github.com/Netflix-Skunkworks/go-jira/commit/aed952b)]
* refactor for GlobalOptions and CommonOptions [Cory Bennett] [[979da1f](https://github.com/Netflix-Skunkworks/go-jira/commit/979da1f)]
* move commands from jiracli package to jiracmd package [Cory Bennett] [[0a5510b](https://github.com/Netflix-Skunkworks/go-jira/commit/0a5510b)]
* use jiracli.Error object to disambiguate between kingpin errors and cli errors [Cory Bennett] [[fb1bfeb](https://github.com/Netflix-Skunkworks/go-jira/commit/fb1bfeb)]
* fix stray newline for list table template [Cory Bennett] [[36c26c5](https://github.com/Netflix-Skunkworks/go-jira/commit/36c26c5)]
* fix dynamic table output when not on tty [Cory Bennett] [[3942f6f](https://github.com/Netflix-Skunkworks/go-jira/commit/3942f6f)]
* when using --verbose set the JIRA_DEBUG environment variable so custom-commands can auto enable verbose output [Cory Bennett] [[da9a2b2](https://github.com/Netflix-Skunkworks/go-jira/commit/da9a2b2)]
* make `jira ISSUE-123` usage call `jira view ISSUE-123` [Cory Bennett] [[ec0858b](https://github.com/Netflix-Skunkworks/go-jira/commit/ec0858b)]
* integrate kingpeon library to allow for custom commands via configuration [Cory Bennett] [[301a61f](https://github.com/Netflix-Skunkworks/go-jira/commit/301a61f)]
* use terminal width to adjust list table output [Cory Bennett] [[2a081dd](https://github.com/Netflix-Skunkworks/go-jira/commit/2a081dd)]
* set yaml/json tags for option structs [Cory Bennett] [[f52d2c4](https://github.com/Netflix-Skunkworks/go-jira/commit/f52d2c4)]
* update generated data files [Cory Bennett] [[c89f11d](https://github.com/Netflix-Skunkworks/go-jira/commit/c89f11d)]
* automatically login when anonymous user detected [Cory Bennett] [[21add54](https://github.com/Netflix-Skunkworks/go-jira/commit/21add54)]
* refactor trivial objects in favor of arguments to static functions [Cory Bennett] [[1f345ce](https://github.com/Netflix-Skunkworks/go-jira/commit/1f345ce)]
* set JIRA_OPERATION when parsing configs. Use figtree config types for options to make defaulting work [Cory Bennett] [[5716a7c](https://github.com/Netflix-Skunkworks/go-jira/commit/5716a7c)]
* add better handing for usage error [Cory Bennett] [[b235dcc](https://github.com/Netflix-Skunkworks/go-jira/commit/b235dcc)]
* adding `request` command, removing dead code [Cory Bennett] [[56b1c9d](https://github.com/Netflix-Skunkworks/go-jira/commit/56b1c9d)]
* adding Do required for request language [Cory Bennett] [[a1c2849](https://github.com/Netflix-Skunkworks/go-jira/commit/a1c2849)]
* add `browse` command and implement -b option for most operations [Cory Bennett] [[a91b9d5](https://github.com/Netflix-Skunkworks/go-jira/commit/a91b9d5)]
* fix IssueAssign [Cory Bennett] [[f32cc70](https://github.com/Netflix-Skunkworks/go-jira/commit/f32cc70)]
* merge in update for upstream changes [#104](https://github.com/Netflix-Skunkworks/go-jira/issues/104) [Cory Bennett] [[19d8686](https://github.com/Netflix-Skunkworks/go-jira/commit/19d8686)]
* add `export-templates` command [Cory Bennett] [[abaad56](https://github.com/Netflix-Skunkworks/go-jira/commit/abaad56)]
* add `issuetypes` command [Cory Bennett] [[da39323](https://github.com/Netflix-Skunkworks/go-jira/commit/da39323)]
* add `components` command [Cory Bennett] [[0bd3ca2](https://github.com/Netflix-Skunkworks/go-jira/commit/0bd3ca2)]
* add `component add` command [Cory Bennett] [[cc90610](https://github.com/Netflix-Skunkworks/go-jira/commit/cc90610)]
* add `take`, `unassign` and `assign|give` commands [Cory Bennett] [[959524a](https://github.com/Netflix-Skunkworks/go-jira/commit/959524a)]
* adding `labels [add|set|remove]` commands [Cory Bennett] [[9161861](https://github.com/Netflix-Skunkworks/go-jira/commit/9161861)]
* add `comment` command [Cory Bennett] [[f0b08c5](https://github.com/Netflix-Skunkworks/go-jira/commit/f0b08c5)]
* add `watch` command [Cory Bennett] [[ec0ac3c](https://github.com/Netflix-Skunkworks/go-jira/commit/ec0ac3c)]
* add `rank ISSUE after|before ISSUE` command [Cory Bennett] [[8b863d2](https://github.com/Netflix-Skunkworks/go-jira/commit/8b863d2)]
* add `vote` command [Cory Bennett] [[a08c92f](https://github.com/Netflix-Skunkworks/go-jira/commit/a08c92f)]
* add `issuelinktypes` command [Cory Bennett] [[37f81a4](https://github.com/Netflix-Skunkworks/go-jira/commit/37f81a4)]
* add `issuelink` command [Cory Bennett] [[aacc9f4](https://github.com/Netflix-Skunkworks/go-jira/commit/aacc9f4)]
* fix closing duplicate issue on `dup` command [Cory Bennett] [[fc696c3](https://github.com/Netflix-Skunkworks/go-jira/commit/fc696c3)]
* rewrite checkpoint [Cory Bennett] [[36632a5](https://github.com/Netflix-Skunkworks/go-jira/commit/36632a5)]
## 0.1.14 - 2017-05-10
* fix unsafe casting for --quiet flag [Cory Bennett] [[6f29f43](https://github.com/Netflix-Skunkworks/go-jira/commit/6f29f43)]
* [[#80](https://github.com/Netflix-Skunkworks/go-jira/issues/80)] add `jira unassign` and `jira give ISSUE --default` commands [Cory Bennett] [[03d8633](https://github.com/Netflix-Skunkworks/go-jira/commit/03d8633)]
## 0.1.13 - 2017-04-24
* work around `github.com/tmc/keyring` compile error for windows [Cory Bennett] [[85298e9](https://github.com/Netflix-Skunkworks/go-jira/commit/85298e9)]
* Added generic issuelink command [David Reuss] [[cc54d11](https://github.com/Netflix-Skunkworks/go-jira/commit/cc54d11)]
* Added --start parameter for pagination on results [David Reuss] [[9b94d9e](https://github.com/Netflix-Skunkworks/go-jira/commit/9b94d9e)]
## 0.1.12 - 2017-03-22
* Implement "browse" subcommand on Windows [Claus Brod] [[ca333d8](https://github.com/Netflix-Skunkworks/go-jira/commit/ca333d8)]
## 0.1.11 - 2017-02-26
* [[#69](https://github.com/Netflix-Skunkworks/go-jira/issues/69)] add subtask command [Cory Bennett] [[21a2ed5](https://github.com/Netflix-Skunkworks/go-jira/commit/21a2ed5)]
## 0.1.10 - 2017-02-08
* set GPG_TTY in .bashrc [Cory Bennett] [[b1e552f](https://github.com/Netflix-Skunkworks/go-jira/commit/b1e552f)]
* force password in case password already exists [Cory Bennett] [[d5a2c3b](https://github.com/Netflix-Skunkworks/go-jira/commit/d5a2c3b)]
* refactor password source, allow for "pass" to be used, update tests to use `password-source: pass` [Cory Bennett] [[5a71939](https://github.com/Netflix-Skunkworks/go-jira/commit/5a71939)]
## 0.1.9 - 2016-12-18
* only warn about needing login when not already running the login command [Cory Bennett] [[6c24e55](https://github.com/Netflix-Skunkworks/go-jira/commit/6c24e55)]
* fix(http): Add proxy transport [William Hearn] [[4bd740b](https://github.com/Netflix-Skunkworks/go-jira/commit/4bd740b)] [[2dff6c9](https://github.com/Netflix-Skunkworks/go-jira/commit/2dff6c9)]
## 0.1.8 - 2016-11-24
* [[#12](https://github.com/Netflix-Skunkworks/go-jira/issues/12)] integrate with keyring for password storage and provide http basic auth credentials for every request since most jira services have websudo enabled with does not allow cookie based authentication [Cory Bennett] [[b8a6e57](https://github.com/Netflix-Skunkworks/go-jira/commit/b8a6e57)]
* Cleaning up usage [Jay Shirley] [[8add52b](https://github.com/Netflix-Skunkworks/go-jira/commit/8add52b)]
* Update usage [Jay Shirley] [[b56e32a](https://github.com/Netflix-Skunkworks/go-jira/commit/b56e32a)]
* use gopkg.in for links to maintain version compatibility [Cory Bennett] [[1414d1f](https://github.com/Netflix-Skunkworks/go-jira/commit/1414d1f)]
* golint [Cory Bennett] [[44cdebf](https://github.com/Netflix-Skunkworks/go-jira/commit/44cdebf)]
* add "rank" command allow ordering backlog issues in agile projects [Cory Bennett] [[e4cc9c6](https://github.com/Netflix-Skunkworks/go-jira/commit/e4cc9c6)]
* Adding a unixproxy mechanism [Jay Shirley] [[5b9c0dd](https://github.com/Netflix-Skunkworks/go-jira/commit/5b9c0dd)]
## 0.1.7 - 2016-08-24
* Prefer transition names which match exactly [Don Brower] [[e40f9c1](https://github.com/Netflix-Skunkworks/go-jira/commit/e40f9c1)]
* update tempates to make them more readable with space trimming added to go-1.6 [Cory Bennett] [[693b3e4](https://github.com/Netflix-Skunkworks/go-jira/commit/693b3e4)]
## 0.1.6 - 2016-08-21
* make "worklogs" command print output through template allow "add worklog" command to open edit template [Cory Bennett] [[cc3fbee](https://github.com/Netflix-Skunkworks/go-jira/commit/cc3fbee)]
* remove extra newline at end of worklogs template [Cory Bennett] [[d08ef15](https://github.com/Netflix-Skunkworks/go-jira/commit/d08ef15)]
* adding worklog related templates [Cory Bennett] [[ab1cd27](https://github.com/Netflix-Skunkworks/go-jira/commit/ab1cd27)]
## 0.1.5 - 2016-08-21
* update for golint [Cory Bennett] [[5a4e17c](https://github.com/Netflix-Skunkworks/go-jira/commit/5a4e17c)]
* fix for go vet [Cory Bennett] [[355fb42](https://github.com/Netflix-Skunkworks/go-jira/commit/355fb42)]
## 0.1.4 - 2016-08-12
* when running "dups" on a Process Management Project type, you have to start/stop the task to resolve it [Cory Bennett] [[2c91905](https://github.com/Netflix-Skunkworks/go-jira/commit/2c91905)]
* allow for defaultResolution option for transition command [Cory Bennett] [[a328c2d](https://github.com/Netflix-Skunkworks/go-jira/commit/a328c2d)]
* add "backlog" command for Kanban related Issues [Cory Bennett] [[5d39b23](https://github.com/Netflix-Skunkworks/go-jira/commit/5d39b23)]
* fix --noedit flag with "dups" command [Cory Bennett] [[37c07fa](https://github.com/Netflix-Skunkworks/go-jira/commit/37c07fa)]
* add "votes" and "labels" to default view template [Cory Bennett] [[6f73b8c](https://github.com/Netflix-Skunkworks/go-jira/commit/6f73b8c)]
* add "blockerType" config param, for issueLinkType use for "blocks" command [Cory Bennett] [[30fd301](https://github.com/Netflix-Skunkworks/go-jira/commit/30fd301)]
* update gitter room [Cory Bennett] [[4b822b1](https://github.com/Netflix-Skunkworks/go-jira/commit/4b822b1)]
* default issuetype to "Bug" for project that have Bug, otherwise try "Task" [Cory Bennett] [[0c807b4](https://github.com/Netflix-Skunkworks/go-jira/commit/0c807b4)]
* make view template only show fields that have values [Cory Bennett] [[8238fe8](https://github.com/Netflix-Skunkworks/go-jira/commit/8238fe8)]
* make default create template only display fields if they are valid fields for the project [Cory Bennett] [[adc2ace](https://github.com/Netflix-Skunkworks/go-jira/commit/adc2ace)]
* ignore empty json fields when processing templates [Cory Bennett] [[f5f3e28](https://github.com/Netflix-Skunkworks/go-jira/commit/f5f3e28)]
* allow JIRA_LOG_FORMAT env variable to control log output format [Cory Bennett] [[469def0](https://github.com/Netflix-Skunkworks/go-jira/commit/469def0)]
* remove extraneous debug [Cory Bennett] [[752a94d](https://github.com/Netflix-Skunkworks/go-jira/commit/752a94d)]
* add logout command modify password prompt to echo masked password [Cory Bennett] [[8ad91be](https://github.com/Netflix-Skunkworks/go-jira/commit/8ad91be)]
* tweak cookies to store hostname dump all http request/response with --verbose [Cory Bennett] [[f93fe79](https://github.com/Netflix-Skunkworks/go-jira/commit/f93fe79)]
* load configs in order of closest to cwd (/etc/go-jira.yml is last) [Cory Bennett] [[f54267b](https://github.com/Netflix-Skunkworks/go-jira/commit/f54267b)]
## 0.1.3 - 2016-07-30
* [[#43](https://github.com/Netflix-Skunkworks/go-jira/issues/43)] add support for jira done|todo|prog commands [Cory Bennett] [[dd7d1cc](https://github.com/Netflix-Skunkworks/go-jira/commit/dd7d1cc)]
* Reporter is not generally editable. [Mike Pountney] [[a637b43](https://github.com/Netflix-Skunkworks/go-jira/commit/a637b43)]
## 0.1.2 - 2016-06-29
* [[#44](https://github.com/Netflix-Skunkworks/go-jira/issues/44)] Close tmpfile before rename to work around "The process cannot access the file because it is being used by another process" error on windows. [Cory Bennett] [[0980f8e](https://github.com/Netflix-Skunkworks/go-jira/commit/0980f8e)]
## 0.1.1 - 2016-06-28
* use USERPROFILE instead of HOME for windows, rework paths to use filepath.Join for better cross platform support [Cory Bennett] [[adcedc4](https://github.com/Netflix-Skunkworks/go-jira/commit/adcedc4)]
* Include templates from a system path [Mike Pountney] [[cf10f53](https://github.com/Netflix-Skunkworks/go-jira/commit/cf10f53)]
* Added support for the ```expand``` option for Issues [tobyjoe] [[fb4afc9](https://github.com/Netflix-Skunkworks/go-jira/commit/fb4afc9)]
* change for api changes to go-logging [Cory Bennett] [[7bfc6e8](https://github.com/Netflix-Skunkworks/go-jira/commit/7bfc6e8)]
* Fix issuetype calls adding URL escaping [Jonathan Wright] [[e4a25e2](https://github.com/Netflix-Skunkworks/go-jira/commit/e4a25e2)]
## 0.1.0 - 2016-01-29
* Fixes [#32](https://github.com/Netflix-Skunkworks/go-jira/issues/32) - make path to cookieFile if it's not present [Mike Pountney] [[6644579](https://github.com/Netflix-Skunkworks/go-jira/commit/6644579)]
* Add component/components support: add and list for now. [Mike Pountney] [[d7b3226](https://github.com/Netflix-Skunkworks/go-jira/commit/d7b3226)]
* Tweak the CmdWatch contract and add watcher remove support [Mike Pountney] [[383847a](https://github.com/Netflix-Skunkworks/go-jira/commit/383847a)]
* Amend vote/unvote to be vote/vote --down [Mike Pountney] [[797edef](https://github.com/Netflix-Skunkworks/go-jira/commit/797edef)]
* Add 'vote' and 'unvote' [Mike Pountney] [[c95e66e](https://github.com/Netflix-Skunkworks/go-jira/commit/c95e66e)]
## 0.0.20 - 2016-01-21
* [issue [#28](https://github.com/Netflix-Skunkworks/go-jira/issues/28)] check to make sure we got back issuetypes for create metadata [Cory Bennett] [[ee0e780](https://github.com/Netflix-Skunkworks/go-jira/commit/ee0e780)]
* Add insecure option for TLS endpoints [Brian Lalor] [[6a88bb9](https://github.com/Netflix-Skunkworks/go-jira/commit/6a88bb9)]
* Correct naming of parameter: set/add/remove are actions. [Mike Pountney] [[303784f](https://github.com/Netflix-Skunkworks/go-jira/commit/303784f)]
* Tweak CmdLabels args so that magic happens with CLI [Mike Pountney] [[40a7c65](https://github.com/Netflix-Skunkworks/go-jira/commit/40a7c65)]
* Expose ViewTicket as per FindIssues [Mike Pountney] [[8977f3d](https://github.com/Netflix-Skunkworks/go-jira/commit/8977f3d)]
* Add exposed versions of getTemplate and runTemplate [Mike Pountney] [[da6cbd5](https://github.com/Netflix-Skunkworks/go-jira/commit/da6cbd5)]
* Add 'labels' command to set/add/remove labels [Mike Pountney] [[230b52d](https://github.com/Netflix-Skunkworks/go-jira/commit/230b52d)]
* Add a 'join' func to the template engine [Mike Pountney] [[a7820fe](https://github.com/Netflix-Skunkworks/go-jira/commit/a7820fe)]
* make "jira" golang package, move code from jira/cli to root, move jira/main.go to main/main.go [Cory Bennett] [[7268b9e](https://github.com/Netflix-Skunkworks/go-jira/commit/7268b9e)]
## 0.0.19 - 2015-12-09
* fix jira trans TRANS ISSUE (case sensitivity issue), also go fmt [Cory Bennett] [[3c30f3b](https://github.com/Netflix-Skunkworks/go-jira/commit/3c30f3b)]
## 0.0.18 - 2015-12-03
* need to default "quiet" to false [Cory Bennett] [[4f4a89b](https://github.com/Netflix-Skunkworks/go-jira/commit/4f4a89b)]
## 0.0.17 - 2015-12-03
* add --quiet command to not print the OK .. add --saveFile option to print the issue/link to a file on create command [Cory Bennett] [[c9ac162](https://github.com/Netflix-Skunkworks/go-jira/commit/c9ac162)]
* fix overrides [Cory Bennett] [[eaddfe6](https://github.com/Netflix-Skunkworks/go-jira/commit/eaddfe6)]
* add abstract request wrapper to allow you to access/process random apis supported by Jira but not yet supported by go-jira [Cory Bennett] [[90ef56a](https://github.com/Netflix-Skunkworks/go-jira/commit/90ef56a)]
## 0.0.16 - 2015-11-23
* jira edit should not require one arguemnt (allow for --query) [Cory Bennett] [[a1eb4a1](https://github.com/Netflix-Skunkworks/go-jira/commit/a1eb4a1)]
## 0.0.15 - 2015-11-23
* [[#17](https://github.com/Netflix-Skunkworks/go-jira/issues/17)] print usage on missing arguments [Cory Bennett] [[fd2a2fe](https://github.com/Netflix-Skunkworks/go-jira/commit/fd2a2fe)]
## 0.0.14 - 2015-11-17
* s/enpoint/endpoint/g [Oliver Schrenk] [[c5d251d](https://github.com/Netflix-Skunkworks/go-jira/commit/c5d251d)]
* Implement dateFormat template command [Mike Pountney] [[68d3bae](https://github.com/Netflix-Skunkworks/go-jira/commit/68d3bae)]
* Add 'updated' field to default queryfields. [Mike Pountney] [[91e2475](https://github.com/Netflix-Skunkworks/go-jira/commit/91e2475)]
* Fix export-templates option (typo) [Mike Pountney] [[4d7fdb8](https://github.com/Netflix-Skunkworks/go-jira/commit/4d7fdb8)]
* when yaml element resolves to "\n" strip it out so we dont post it to jira [Cory Bennett] [[47ced2f](https://github.com/Netflix-Skunkworks/go-jira/commit/47ced2f)]
* print PUT/POST data when using --dryrun to help debug [Cory Bennett] [[618f245](https://github.com/Netflix-Skunkworks/go-jira/commit/618f245)]
## 0.0.13 - 2015-09-19
* replace dead/deprecated code.google.com/p/gopass with golang.org/x/crypto/ssh/terminal for reading password from stdin [Cory Bennett] [[909eb06](https://github.com/Netflix-Skunkworks/go-jira/commit/909eb06)]
## 0.0.12 - 2015-09-18
* fix exception from "jira create" [Cory Bennett] [[9348a4b](https://github.com/Netflix-Skunkworks/go-jira/commit/9348a4b)]
* add some debug messages to help diagnose login failures [Cory Bennett] [[1c08a7d](https://github.com/Netflix-Skunkworks/go-jira/commit/1c08a7d)]
## 0.0.11 - 2015-09-16
* add --version [Cory Bennett] [[8385ee2](https://github.com/Netflix-Skunkworks/go-jira/commit/8385ee2)]
* fix command line parser broken in 0.0.10 [Cory Bennett] [[15ae929](https://github.com/Netflix-Skunkworks/go-jira/commit/15ae929)]
## 0.0.10 - 2015-09-15
* allow for command aliasing in conjunction with executable config files. Issue #5 [Cory Bennett] [[23590d4](https://github.com/Netflix-Skunkworks/go-jira/commit/23590d4)]
* update usage [Cory Bennett] [[ef7a57e](https://github.com/Netflix-Skunkworks/go-jira/commit/ef7a57e)]
## 0.0.9 - 2015-09-15
* use forked yaml.v2 so as to not lose line terminations present in jira fields [Cory Bennett] [[f84e77f](https://github.com/Netflix-Skunkworks/go-jira/commit/f84e77f)]
* adding a |~ literal yaml syntax to just chomp a single newline (again to preserve existing formatting in jira fields) [Cory Bennett] [[f84e77f](https://github.com/Netflix-Skunkworks/go-jira/commit/f84e77f)]
* for indent/comment allow for unicode line termination characters that yaml will use for parsing [Cory Bennett] [[f84e77f](https://github.com/Netflix-Skunkworks/go-jira/commit/f84e77f)]
* fix "edit" default option, change how defaults are dealt with for filters [Cory Bennett] [[4265913](https://github.com/Netflix-Skunkworks/go-jira/commit/4265913)]
* for edit template add issue id as comment, also add "comments" as comment so you can review the comment details while editing [Cory Bennett] [[968a9df](https://github.com/Netflix-Skunkworks/go-jira/commit/968a9df)]
* add "comment" template filter to comment out multiline statements [Cory Bennett] [[d664868](https://github.com/Netflix-Skunkworks/go-jira/commit/d664868)]
* add getOpt wrappers to get options with defaults [Cory Bennett] [[c0070cf](https://github.com/Netflix-Skunkworks/go-jira/commit/c0070cf)]
* make --dryrun work [Cory Bennett] [[d229ac1](https://github.com/Netflix-Skunkworks/go-jira/commit/d229ac1)]
* refactor config/option loading so command options override settings in config files [Cory Bennett] [[d229ac1](https://github.com/Netflix-Skunkworks/go-jira/commit/d229ac1)]
* allow query options to be used on the "edit" command to iterate editing [Cory Bennett] [[d229ac1](https://github.com/Netflix-Skunkworks/go-jira/commit/d229ac1)]
* remove duplication for defaults [Cory Bennett] [[f8c8ddf](https://github.com/Netflix-Skunkworks/go-jira/commit/f8c8ddf)]
* use optigo for option parsing, drop docopt [Cory Bennett] [[7bbd571](https://github.com/Netflix-Skunkworks/go-jira/commit/7bbd571)]
* allow "abort: true" to be set while editing to cancel the edit operation [Cory Bennett] [[ea67a77](https://github.com/Netflix-Skunkworks/go-jira/commit/ea67a77)]
* if no changes are made on edit templates then abort edit [Cory Bennett] [[e69b65c](https://github.com/Netflix-Skunkworks/go-jira/commit/e69b65c)]
## 0.0.8 - 2015-07-31
* Add --max_results option for 'ls' [Mike Pountney] [[e06ff0c](https://github.com/Netflix-Skunkworks/go-jira/commit/e06ff0c)]
## 0.0.7 - 2015-07-01
* fix "take" command not honouring user option [Andrew Haigh] [[8f1d2b9](https://github.com/Netflix-Skunkworks/go-jira/commit/8f1d2b9)]
* fix typo [Cory Bennett] [[06f57fe](https://github.com/Netflix-Skunkworks/go-jira/commit/06f57fe)]
## 0.0.6 - 2015-02-27
* allow --sort= to disable sort override [Cory Bennett] [[701f091](https://github.com/Netflix-Skunkworks/go-jira/commit/701f091)]
* fix default JIRA_OPERATION env variable [Cory Bennett] [[82fd9b9](https://github.com/Netflix-Skunkworks/go-jira/commit/82fd9b9)]
* automatically close duplicate issues with "Duplicate" resolution [Cory Bennett] [[ebf1700](https://github.com/Netflix-Skunkworks/go-jira/commit/ebf1700)]
* set JIRA_OPERATION to "view" when no operation used (ie: jira GOJIRA-123) [Cory Bennett] [[050848a](https://github.com/Netflix-Skunkworks/go-jira/commit/050848a)]
* add --sort option to "list" command [Cory Bennett] [[f359030](https://github.com/Netflix-Skunkworks/go-jira/commit/f359030)]
## 0.0.5 - 2015-02-21
* handle editor having arguments [Cory Bennett] [[7186fb3](https://github.com/Netflix-Skunkworks/go-jira/commit/7186fb3)]
* add more template error handling [Cory Bennett] [[3e6f2b3](https://github.com/Netflix-Skunkworks/go-jira/commit/3e6f2b3)]
* allow create template to specify defalt watchers with -o watchers=... [Cory Bennett] [[4db2e4e](https://github.com/Netflix-Skunkworks/go-jira/commit/4db2e4e)]
* if config files are executable then run them and parse the output [Cory Bennett] [[7a2f7f5](https://github.com/Netflix-Skunkworks/go-jira/commit/7a2f7f5)]
## 0.0.4 - 2015-02-19
* add --template option to export-templates to export a single template [Cory Bennett] [[343fbb6](https://github.com/Netflix-Skunkworks/go-jira/commit/343fbb6)]
* add "table" template to be used with "list" command [Cory Bennett] [[8954ec1](https://github.com/Netflix-Skunkworks/go-jira/commit/8954ec1)]
## 0.0.3 - 2015-02-19
* [issue [#8](https://github.com/Netflix-Skunkworks/go-jira/issues/8)] detect X-Seraph-Loginreason: AUTHENTICATION_DENIED header to catch login failures [Cory Bennett] [[2dcf665](https://github.com/Netflix-Skunkworks/go-jira/commit/2dcf665)]
* project should always be uppercase [Jay Buffington] [[1b69d12](https://github.com/Netflix-Skunkworks/go-jira/commit/1b69d12)]
* if response is 400, check json for errorMessages and log them [Jay Buffington] [[4924dfa](https://github.com/Netflix-Skunkworks/go-jira/commit/4924dfa)]
* validate project [Jay Buffington] [[dc5ae42](https://github.com/Netflix-Skunkworks/go-jira/commit/dc5ae42)]
## 0.0.2 - 2015-02-18
* add missing --override options on transition command
* add browse command
## 0.0.1 - 2015-02-18
* Initial experimental release
+5 -4
View File
@@ -19,6 +19,7 @@ GOBIN ?= $(CWD)
CURVER ?= $(patsubst v%,%,$(shell [ -d .git ] && git describe --abbrev=0 --tags || grep ^\#\# CHANGELOG.md | awk '{print $$2; exit}'))
LDFLAGS:= -w
VERSION ?= development
build:
$(GO) build -gcflags="-e" -v -ldflags "$(LDFLAGS) -s" -o '$(BIN)' cmd/jira/main.go
@@ -39,10 +40,10 @@ lint:
@golint ./cmd/jira
all:
GO111MODULE=off $(GO) get -u src.techknowlogick.com/xgo
GO111MODULE=off $(GO) get -u github.com/mitchellh/gox
rm -rf dist
mkdir -p dist
xgo --targets="freebsd/amd64,linux/386,linux/amd64,windows/386,windows/amd64,darwin/amd64" -dest ./dist -ldflags="-w -s" ./cmd/jira
gox -ldflags="-w -s" -ldflags="-X 'github.com/go-jira/jira.VERSION=$(VERSION)'" -output="dist/github.com/go-jira/jira-{{.OS}}-{{.Arch}}" -osarch="darwin/amd64 linux/386 linux/amd64 windows/386 windows/amd64" ./cmd/jira
install:
${MAKE} GOBIN=$$HOME/bin build
@@ -88,8 +89,8 @@ clean-password-store:
rm -f "$(CWD)/_t/.password-store/GoJira/api-token:mothra@corybennett.org.gpg"
test-password-store:
ln -s "$(CWD)/_t/.password-store/GoJira/api-token__gojira@corybennett.org.gpg" "$(CWD)/_t/.password-store/GoJira/api-token:gojira@corybennett.org.gpg"
ln -s "$(CWD)/_t/.password-store/GoJira/api-token__mothra@corybennett.org.gpg" "$(CWD)/_t/.password-store/GoJira/api-token:mothra@corybennett.org.gpg"
ln -s "api-token__gojira@corybennett.org.gpg" "$(CWD)/_t/.password-store/GoJira/api-token:gojira@corybennett.org.gpg"
ln -s "api-token__mothra@corybennett.org.gpg" "$(CWD)/_t/.password-store/GoJira/api-token:mothra@corybennett.org.gpg"
prove: test-password-store
chmod -R g-rwx,o-rwx $(CWD)/_t/.gnupg
+69 -6
View File
@@ -1,4 +1,4 @@
[![Build Status](https://travis-ci.org/go-jira/jira/go-jira.svg?branch=master)](https://travis-ci.org/go-jira/jira)
[![Build Status](https://travis-ci.org/go-jira/jira.svg?branch=master)](https://travis-ci.org/go-jira/jira)
[![GoDoc](https://godoc.org/github.com/go-jira/jira?status.svg)](https://godoc.org/github.com/go-jira/jira)
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
@@ -6,6 +6,14 @@
Simple command line client for Atlassian's Jira service written in Go.
## GDPR USERNAME DISCLAIMER
When this tool was initial written the "username" parameter was widely used in the Atlassian API.
Due to GDPR restrictions this parameter was been almost completely phased out other then V1 login.
The "--user" field is still provided as a default global, however moving forward any usage of this field should be phased out in favor of the "--login" option.
Commands which previously took a username will now expect an email address such as watch, create, assign, etc...
## Install
### Download
@@ -14,13 +22,13 @@ You can download one of the pre-built binaries for **go-jira** [here](https://gi
### Build
You can build and install the official repository with [Go](https://golang.org/dl/):
You can build and install the official repository with [Go](https://golang.org/dl/) (before running the below command, ensure you have `GO111MODULE=on` set in your environment):
go get github.com/go-jira/jira/cmd/jira
This will checkout this repository into `$GOPATH/src/github.com/go-jira/jira/`, build, and install it.
It should then be available in $GOPATH/bin/jira
It should then be available in $GOPATH/bin/jira.
## Usage
@@ -234,7 +242,7 @@ custom-commands:
{{jira}} list --template table --query "sprint in openSprints() and type != epic and resolution = unresolved and project=$JIRA_PROJECT ORDER BY rank asc, created"
else
# otherwise list issues for all project
echo "\"project: ...\" configuration missing from .jira.d/config.yml"
{{jira}} list --template table --query "sprint in openSprints() and type != epic and resolution = unresolved ORDER BY rank asc, created"
fi
```
@@ -274,11 +282,39 @@ jira list -t debug
### Authentication
For Atlassian Cloud hosted Jira [API Tokens are now required](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-basic-auth-and-cookie-based-auth/). You will automatically be prompted for an API Token if your jira endpoint ends in `.atlassian.net`. If you are using a private Jira service, you can force `jira` to use an api-token by setting the `authentication-method: api-token` property in your `$HOME/.jira.d/config.yml` file. The API Token needs to be presented to the Jira service on every request, so it is recommended to store this API Token security within your OS's keyring, or using the `pass` service as documented below so that it can be programmatically accessed via `jira` and not prompt you every time. For a less-secure option you can also provide the API token via a `JIRA_API_TOKEN` environment variable. If you are unable to use an api-token for an Atlassian Cloud hosted Jira then you can still force `jira` to use the old session based authentication (until it the hosted system stops accepting it) by setting `authentication-method: session`.
#### Atlassian Cloud
For Atlassian Cloud hosted Jira [API Tokens are now required](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-basic-auth-and-cookie-based-auth/). You will automatically be prompted for an API Token if your jira endpoint ends in `.atlassian.net`.
##### Quickstart API Token and Keychain
1. Edit your config or execute the snippit (make sure to replace `<SUBDOMAIN>` and `<EMAIL>`)
```
export SUBDOMAIN="https://<SUBDOMAIN>.atlassian.net"
export EMAIL="<EMAIL>"
mkdir -p ~/.jira.d
printf "endpoint: $SUBDOMAIN\nuser: $EMAIL\npassword-source: keyring" > ~/.jira.d/config.yml
```
2. Create a new API Token at [id.atlassian.com](https://id.atlassian.com/manage-profile/security)
3. Execute `jira session` and enter your API Token. `jira` will add your session to the keyring.
#### Private Jira Service
If you are using a private Jira service, you can force `jira` to use an api-token by setting the `authentication-method: api-token` property in your `$HOME/.jira.d/config.yml` file. The API Token needs to be presented to the Jira service on every request, so it is recommended to store this API Token security within your OS's keyring, or using the `pass`/`gopass` service as documented below so that it can be programmatically accessed via `jira` and not prompt you every time. For a less-secure option you can also provide the API token via a `JIRA_API_TOKEN` environment variable. If you are unable to use an api-token for an Atlassian Cloud hosted Jira then you can still force `jira` to use the old session based authentication (until it the hosted system stops accepting it) by setting `authentication-method: session`.
The API Token authentication requires both the token and the email of the user. The email mut be set in the `user:` in your config.yml. Failure to provide the `user` will result in a 401 error.
If your Jira service still allows you to use the Session based authentication method then `jira` will prompt for a password automatically when get a response header from the Jira service that indicates you do not have an active session (ie the `X-Ausername` header is set to `anonymous`). Then after authentication we cache the `cloud.session.token` cookie returned by the service [session login api](https://docs.atlassian.com/jira/REST/cloud/#auth/1/session-login) and reuse that on subsequent requests. Typically this cookie will be valid for several hours (depending on the service configuration). To automatically securely store your password for easy reuse by jira You can enable a `password-source` via `.jira.d/config.yml` with possible values of `keyring` or `pass`.
If your Jira service still allows you to use the Session based authentication method then `jira` will prompt for a password automatically when get a response header from the Jira service that indicates you do not have an active session (ie the `X-Ausername` header is set to `anonymous`). Then after authentication we cache the `cloud.session.token` cookie returned by the service [session login api](https://docs.atlassian.com/jira/REST/cloud/#auth/1/session-login) and reuse that on subsequent requests. Typically this cookie will be valid for several hours (depending on the service configuration). To automatically securely store your password for easy reuse by jira You can enable a `password-source` via `.jira.d/config.yml` with possible values of `keyring`, `pass` or `gopass`.
Depending on how your private Jira service is configured, API tokens may require the "[Bearer][]" authentication scheme instead of the traditional "[Basic][]" [authentication scheme][scheme]. In this case, set the `authentication-method: bearer-token` property in your `$HOME/.jira.d/config.yml` file.
[scheme]: https://developer.mozilla.org/en-US/docs/Web/HTTP/Authentication#authentication_schemes
[Bearer]: https://datatracker.ietf.org/doc/html/rfc6750
[Basic]: https://tools.ietf.org/html/rfc7617
| **API token [scheme][]** | `authentication-method` | **Example HTTP request header** |
|:------------------------:|-------------------------|-------------------------------------------------|
| [Basic][] | `api-token` | `Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQK` |
| [Bearer][] | `bearer-token` | `Authorization: Bearer MY_TOKEN` |
#### User vs Login
The Jira service has sometimes differing opinions about how a user is identified. In other words the ID you login with might not be ID that the jira system recognized you as. This matters when trying to identify a user via various Jira REST APIs (like issue assignment). This is especially relevant when trying to authenticate with an API Token where the authentication user is usually an email address, but within the Jira system the user is identified by a user name. To accommodate this `jira` now supports two different properties in the config file. So when authentication using the API Tokens you will likely want something like this in your `$HOME/.jira.d/config.yml` file:
@@ -356,6 +392,17 @@ fi
export GPG_TTY=$(tty)
```
#### `gopass` password source
There is also the possibility to use [gopass](https://www.gopass.pw/) as a password source. `gopass` (like `pass`) uses gpg to encrypt/decrypt passwords. To use `gopass` for password storagte and retrieval via `go-jira` just add this configuration to `$HOME/.jira.d/config.yml`:
```yaml
password-source: gopass
password-name: jira.example.com/myuser
```
For this to work, you need a working `gopass` installation.
To configure your `gpg-agent` to cache your gpg passphrase take a look at the `pass` section of the readme.
#### `stdin` password source
When `password-source` is set to `stdin`, the `jira login` command will read from stdin until EOF, and the bytes read will be the used as the password. This is useful if you have some other programmatic method for fetching passwords. For example, if `password-generator` creates a one-time password and prints it to stdout, you could use it like this.
@@ -363,3 +410,19 @@ When `password-source` is set to `stdin`, the `jira login` command will read fro
```bash
$ ./password-generator | jira login --endpoint=https://my.jira.endpoint.com --user=USERNAME
```
#### Switch path used for password source
For `gopass` and `pass` it is possible to specify the full path for the `password-source` tool used for retrieval of the password. This can be accomplised
by setting the `password-source-path` option in the configuration file.
E.g.
```yaml
password-source: gopass
password-name: jira.example.com/myuser
password-source-path: /path/to/my-special-gopass
```
This will cause go-jira to use the `gopass` style cli interaction with the `my-special-gopass` binary.
If you ommit the `password-source-path` option, either `gopass` (for `gopass`) or `pass` (for `pass`)
will be used.
+37 -37
View File
@@ -35,8 +35,8 @@ status: To Do
summary: summary
project: BASIC
issuetype: Bug
assignee: gojira
reporter: gojira
assignee: GoJira
reporter: GoJira
priority: Medium
votes: 0
description: |
@@ -66,11 +66,11 @@ EOF
RUNS $jira ls --project BASIC --template table
DIFF <<EOF
+----------------+------------------------------------------+--------------+--------------+--------------+------------+--------------+--------------+
| Issue | Summary | Type | Priority | Status | Age | Reporter | Assignee |
+----------------+------------------------------------------+--------------+--------------+--------------+------------+--------------+--------------+
| $(printf %-14s $issue) | summary | Bug | Medium | To Do | a minute | gojira | gojira |
+----------------+------------------------------------------+--------------+--------------+--------------+------------+--------------+--------------+
+------------+---------+------+----------+--------+----------+----------+----------+
| Issue | Summary | Type | Priority | Status | Age | Reporter | Assignee |
+------------+---------+------+----------+--------+----------+----------+----------+
| $issue | summary | Bug | Medium | To Do | a minute | GoJira | GoJira |
+------------+---------+------+----------+--------+----------+----------+----------+
EOF
###############################################################################
@@ -97,17 +97,17 @@ status: To Do
summary: summary
project: BASIC
issuetype: Bug
assignee: gojira
reporter: gojira
assignee: GoJira
reporter: GoJira
priority: High
votes: 0
description: |
description
comments:
- | # gojira, a minute ago
- | # GoJira, a minute ago
edit comment
- | # gojira, a minute ago
- | # GoJira, a minute ago
bulk edit comment
EOF
@@ -174,8 +174,8 @@ status: To Do
summary: summary
project: BASIC
issuetype: Bug
assignee: gojira
reporter: gojira
assignee: GoJira
reporter: GoJira
blockers:
depends: $dup[Done]
priority: Medium
@@ -221,8 +221,8 @@ status: To Do
summary: summary
project: BASIC
issuetype: Bug
assignee: gojira
reporter: gojira
assignee: GoJira
reporter: GoJira
blockers: $blocker[To Do]
depends: $dup[Done]
priority: Medium
@@ -267,8 +267,8 @@ status: To Do
summary: summary
project: BASIC
issuetype: Bug
assignee: gojira
reporter: gojira
assignee: GoJira
reporter: GoJira
blockers: $blocker[To Do]
depends: $dup[Done]
priority: Medium
@@ -294,8 +294,8 @@ status: To Do
summary: summary
project: BASIC
issuetype: Bug
assignee: gojira
reporter: gojira
assignee: GoJira
reporter: GoJira
blockers: $blocker[To Do]
depends: $dup[Done]
priority: Medium
@@ -314,10 +314,10 @@ OK $issue $ENDPOINT/browse/$issue
EOF
# FIXME we probably need a watchers command to wrap this?
RUNS sh -c "$jira req /rest/api/2/issue/$issue/watchers | jq -r .watchers[].name | sort"
RUNS sh -c "$jira req /rest/api/2/issue/$issue/watchers | jq -r .watchers[].displayName | sort"
DIFF <<EOF
gojira
mothra
GoJira
Mothra
EOF
###############################################################################
@@ -386,8 +386,8 @@ status: To Do
summary: summary
project: BASIC
issuetype: Bug
assignee: gojira
reporter: gojira
assignee: GoJira
reporter: GoJira
blockers: $blocker[Done]
depends: $dup[Done]
priority: Medium
@@ -413,8 +413,8 @@ status: To Do
summary: summary
project: BASIC
issuetype: Bug
assignee: gojira
reporter: gojira
assignee: GoJira
reporter: GoJira
blockers: $blocker[Done]
depends: $dup[Done]
priority: Medium
@@ -423,7 +423,7 @@ description: |
description
comments:
- | # mothra, a minute ago
- | # Mothra, a minute ago
Yo, Comment
EOF
@@ -445,8 +445,8 @@ status: Done
summary: blocks
project: BASIC
issuetype: Bug
assignee: gojira
reporter: gojira
assignee: GoJira
reporter: GoJira
blockers:
depends: $issue[To Do]
priority: Medium
@@ -473,8 +473,8 @@ status: Done
summary: blocks
project: BASIC
issuetype: Bug
assignee: gojira
reporter: gojira
assignee: GoJira
reporter: GoJira
blockers:
depends: $issue[To Do]
priority: Medium
@@ -501,8 +501,8 @@ status: Done
summary: blocks
project: BASIC
issuetype: Bug
assignee: gojira
reporter: gojira
assignee: GoJira
reporter: GoJira
blockers:
depends: $issue[To Do]
priority: Medium
@@ -529,8 +529,8 @@ status: Done
summary: blocks
project: BASIC
issuetype: Bug
assignee: mothra
reporter: gojira
assignee: Mothra
reporter: GoJira
blockers:
depends: $issue[To Do]
priority: Medium
@@ -557,8 +557,8 @@ status: Done
summary: blocks
project: BASIC
issuetype: Bug
assignee: gojira
reporter: gojira
assignee: GoJira
reporter: GoJira
blockers:
depends: $issue[To Do]
priority: Medium
+48
View File
@@ -0,0 +1,48 @@
#!/bin/bash
eval "$(curl -q -s https://raw.githubusercontent.com/coryb/osht/master/osht.sh)"
cd $(dirname $0)
jira="../jira"
. env.sh
PLAN 6
# reset login
RUNS $jira logout
RUNS $jira login
# cleanup from previous failed test executions
($jira ls --project BASIC | awk -F: '{print $1}' | while read issue; do ../jira done $issue; done) | sed 's/^/# CLEANUP: /g'
###############################################################################
## Create an issue
###############################################################################
RUNS $jira create --project BASIC -o summary=summary -o description=description --noedit --saveFile issue.props
issue=$(awk '/issue/{print $2}' issue.props)
DIFF <<EOF
OK $issue $ENDPOINT/browse/$issue
EOF
# just get the number
shortIssue=${issue#BASIC-}
###############################################################################
## View the issue we just created
###############################################################################
RUNS $jira view $shortIssue
DIFF <<EOF
issue: $issue
created: a minute ago
status: To Do
summary: summary
project: BASIC
issuetype: Bug
assignee: GoJira
reporter: GoJira
priority: Medium
votes: 0
description: |
description
EOF
+1 -1
View File
@@ -36,7 +36,7 @@ EOF
###############################################################################
RUNS $jira worklog $issue
DIFF <<EOF
- # gojira, a minute ago
- # GoJira, a minute ago
comment: work is hard
started: 2017-01-29T06:17:00.000-0800
timeSpent: 1h 12m
+5 -5
View File
@@ -72,9 +72,9 @@ EOF
RUNS $jira mine
DIFF <<EOF
+----------------+------------------------------------------+--------------+--------------+--------------+------------+--------------+--------------+
| Issue | Summary | Type | Priority | Status | Age | Reporter | Assignee |
+----------------+------------------------------------------+--------------+--------------+--------------+------------+--------------+--------------+
| $(printf %-14s $issue) | summary | Bug | Medium | To Do | a minute | gojira | gojira |
+----------------+------------------------------------------+--------------+--------------+--------------+------------+--------------+--------------+
+------------+---------+------+----------+--------+----------+----------+----------+
| Issue | Summary | Type | Priority | Status | Age | Reporter | Assignee |
+------------+---------+------+----------+--------+----------+----------+----------+
| $issue | summary | Bug | Medium | To Do | a minute | GoJira | GoJira |
+------------+---------+------+----------+--------+----------+----------+----------+
EOF
+19 -19
View File
@@ -46,10 +46,10 @@ EOF
RUNS $jira epic list $epic
DIFF<<EOF
+----------------+------------------------------------------+--------------+--------------+--------------+------------+--------------+--------------+
| Issue | Summary | Type | Priority | Status | Age | Reporter | Assignee |
+----------------+------------------------------------------+--------------+--------------+--------------+------------+--------------+--------------+
+----------------+------------------------------------------+--------------+--------------+--------------+------------+--------------+--------------+
+-------+---------+------+----------+--------+-----+----------+----------+
| Issue | Summary | Type | Priority | Status | Age | Reporter | Assignee |
+-------+---------+------+----------+--------+-----+----------+----------+
+-------+---------+------+----------+--------+-----+----------+----------+
EOF
###############################################################################
@@ -69,12 +69,12 @@ EOF
RUNS $jira epic list $epic
DIFF<<EOF
+----------------+------------------------------------------+--------------+--------------+--------------+------------+--------------+--------------+
| Issue | Summary | Type | Priority | Status | Age | Reporter | Assignee |
+----------------+------------------------------------------+--------------+--------------+--------------+------------+--------------+--------------+
| $(printf %-14s $issue1) | summary | Bug | Medium | To Do | a minute | gojira | gojira |
| $(printf %-14s $issue2) | summary | Bug | Medium | To Do | a minute | gojira | gojira |
+----------------+------------------------------------------+--------------+--------------+--------------+------------+--------------+--------------+
+------------+---------+------+----------+--------+----------+----------+----------+
| Issue | Summary | Type | Priority | Status | Age | Reporter | Assignee |
+------------+---------+------+----------+--------+----------+----------+----------+
| $issue1 | summary | Bug | Medium | To Do | a minute | GoJira | GoJira |
| $issue2 | summary | Bug | Medium | To Do | a minute | GoJira | GoJira |
+------------+---------+------+----------+--------+----------+----------+----------+
EOF
###############################################################################
@@ -92,11 +92,11 @@ EOF
RUNS $jira epic list $epic
DIFF<<EOF
+----------------+------------------------------------------+--------------+--------------+--------------+------------+--------------+--------------+
| Issue | Summary | Type | Priority | Status | Age | Reporter | Assignee |
+----------------+------------------------------------------+--------------+--------------+--------------+------------+--------------+--------------+
| $(printf %-14s $issue2) | summary | Bug | Medium | To Do | a minute | gojira | gojira |
+----------------+------------------------------------------+--------------+--------------+--------------+------------+--------------+--------------+
+------------+---------+------+----------+--------+----------+----------+----------+
| Issue | Summary | Type | Priority | Status | Age | Reporter | Assignee |
+------------+---------+------+----------+--------+----------+----------+----------+
| $issue2 | summary | Bug | Medium | To Do | a minute | GoJira | GoJira |
+------------+---------+------+----------+--------+----------+----------+----------+
EOF
###############################################################################
@@ -114,8 +114,8 @@ EOF
RUNS $jira epic list $epic
DIFF<<EOF
+----------------+------------------------------------------+--------------+--------------+--------------+------------+--------------+--------------+
| Issue | Summary | Type | Priority | Status | Age | Reporter | Assignee |
+----------------+------------------------------------------+--------------+--------------+--------------+------------+--------------+--------------+
+----------------+------------------------------------------+--------------+--------------+--------------+------------+--------------+--------------+
+-------+---------+------+----------+--------+-----+----------+----------+
| Issue | Summary | Type | Priority | Status | Age | Reporter | Assignee |
+-------+---------+------+----------+--------+-----+----------+----------+
+-------+---------+------+----------+--------+-----+----------+----------+
EOF
+22 -22
View File
@@ -59,13 +59,13 @@ EOF
###############################################################################
RUNS $jira attach list $issue
DIFF <<EOF
+------------+------------------------------+------------+--------------+--------------+
| id | filename | bytes | user | created |
+------------+------------------------------+------------+--------------+--------------+
| $(printf %10s $attach1) | README.md | 1239 | gojira | a minute |
| $(printf %10s $attach2) | garbage.bin | 1048576 | gojira | a minute |
| $(printf %10s $attach3) | foobar.bin | 1048576 | gojira | a minute |
+------------+------------------------------+------------+--------------+--------------+
+-------+-------------+---------+--------+----------+
| id | filename | bytes | user | created |
+-------+-------------+---------+--------+----------+
| $attach1 | README.md | 1239 | GoJira | a minute |
| $attach2 | garbage.bin | 1048576 | GoJira | a minute |
| $attach3 | foobar.bin | 1048576 | GoJira | a minute |
+-------+-------------+---------+--------+----------+
EOF
###############################################################################
@@ -146,12 +146,12 @@ EOF
RUNS $jira attach list $issue
DIFF <<EOF
+------------+------------------------------+------------+--------------+--------------+
| id | filename | bytes | user | created |
+------------+------------------------------+------------+--------------+--------------+
| $(printf %10s $attach2) | garbage.bin | 1048576 | gojira | a minute |
| $(printf %10s $attach3) | foobar.bin | 1048576 | gojira | a minute |
+------------+------------------------------+------------+--------------+--------------+
+-------+-------------+---------+--------+----------+
| id | filename | bytes | user | created |
+-------+-------------+---------+--------+----------+
| $attach2 | garbage.bin | 1048576 | GoJira | a minute |
| $attach3 | foobar.bin | 1048576 | GoJira | a minute |
+-------+-------------+---------+--------+----------+
EOF
@@ -165,11 +165,11 @@ EOF
RUNS $jira attach list $issue
DIFF <<EOF
+------------+------------------------------+------------+--------------+--------------+
| id | filename | bytes | user | created |
+------------+------------------------------+------------+--------------+--------------+
| $(printf %10s $attach3) | foobar.bin | 1048576 | gojira | a minute |
+------------+------------------------------+------------+--------------+--------------+
+-------+------------+---------+--------+----------+
| id | filename | bytes | user | created |
+-------+------------+---------+--------+----------+
| $attach3 | foobar.bin | 1048576 | GoJira | a minute |
+-------+------------+---------+--------+----------+
EOF
###############################################################################
@@ -182,8 +182,8 @@ EOF
RUNS $jira attach list $issue
DIFF <<EOF
+------------+------------------------------+------------+--------------+--------------+
| id | filename | bytes | user | created |
+------------+------------------------------+------------+--------------+--------------+
+------------+------------------------------+------------+--------------+--------------+
+----+----------+-------+------+---------+
| id | filename | bytes | user | created |
+----+----------+-------+------+---------+
+----+----------+-------+------+---------+
EOF
+28 -28
View File
@@ -35,8 +35,8 @@ status: To Do
summary: summary
project: SCRUM
issuetype: Bug
assignee: gojira
reporter: gojira
assignee: GoJira
reporter: GoJira
priority: Medium
votes: 0
description: |
@@ -114,8 +114,8 @@ status: To Do
summary: summary
project: SCRUM
issuetype: Bug
assignee: gojira
reporter: gojira
assignee: GoJira
reporter: GoJira
blockers:
depends: $dup[Done]
priority: Medium
@@ -161,8 +161,8 @@ status: To Do
summary: summary
project: SCRUM
issuetype: Bug
assignee: gojira
reporter: gojira
assignee: GoJira
reporter: GoJira
blockers: $blocker[To Do]
depends: $dup[Done]
priority: Medium
@@ -207,8 +207,8 @@ status: To Do
summary: summary
project: SCRUM
issuetype: Bug
assignee: gojira
reporter: gojira
assignee: GoJira
reporter: GoJira
blockers: $blocker[To Do]
depends: $dup[Done]
priority: Medium
@@ -234,8 +234,8 @@ status: To Do
summary: summary
project: SCRUM
issuetype: Bug
assignee: gojira
reporter: gojira
assignee: GoJira
reporter: GoJira
blockers: $blocker[To Do]
depends: $dup[Done]
priority: Medium
@@ -254,10 +254,10 @@ OK $issue $ENDPOINT/browse/$issue
EOF
# FIXME we probably need a watchers command to wrap this?
RUNS sh -c "$jira req /rest/api/2/issue/$issue/watchers | jq -r .watchers[].name | sort"
RUNS sh -c "$jira req /rest/api/2/issue/$issue/watchers | jq -r .watchers[].displayName | sort"
DIFF <<EOF
gojira
mothra
GoJira
Mothra
EOF
###############################################################################
@@ -326,8 +326,8 @@ status: To Do
summary: summary
project: SCRUM
issuetype: Bug
assignee: gojira
reporter: gojira
assignee: GoJira
reporter: GoJira
blockers: $blocker[Done]
depends: $dup[Done]
priority: Medium
@@ -353,8 +353,8 @@ status: To Do
summary: summary
project: SCRUM
issuetype: Bug
assignee: gojira
reporter: gojira
assignee: GoJira
reporter: GoJira
blockers: $blocker[Done]
depends: $dup[Done]
priority: Medium
@@ -363,7 +363,7 @@ description: |
description
comments:
- | # mothra, a minute ago
- | # Mothra, a minute ago
Yo, Comment
EOF
@@ -385,8 +385,8 @@ status: Done
summary: blocks
project: SCRUM
issuetype: Bug
assignee: gojira
reporter: gojira
assignee: GoJira
reporter: GoJira
blockers:
depends: $issue[To Do]
priority: Medium
@@ -413,8 +413,8 @@ status: Done
summary: blocks
project: SCRUM
issuetype: Bug
assignee: gojira
reporter: gojira
assignee: GoJira
reporter: GoJira
blockers:
depends: $issue[To Do]
priority: Medium
@@ -441,8 +441,8 @@ status: Done
summary: blocks
project: SCRUM
issuetype: Bug
assignee: gojira
reporter: gojira
assignee: GoJira
reporter: GoJira
blockers:
depends: $issue[To Do]
priority: Medium
@@ -469,8 +469,8 @@ status: Done
summary: blocks
project: SCRUM
issuetype: Bug
assignee: mothra
reporter: gojira
assignee: Mothra
reporter: GoJira
blockers:
depends: $issue[To Do]
priority: Medium
@@ -497,8 +497,8 @@ status: Done
summary: blocks
project: SCRUM
issuetype: Bug
assignee: gojira
reporter: gojira
assignee: GoJira
reporter: GoJira
blockers:
depends: $issue[To Do]
priority: Medium
+28 -28
View File
@@ -35,8 +35,8 @@ status: Backlog
summary: summary
project: KANBAN
issuetype: Bug
assignee: gojira
reporter: gojira
assignee: GoJira
reporter: GoJira
priority: Medium
votes: 0
description: |
@@ -114,8 +114,8 @@ status: Backlog
summary: summary
project: KANBAN
issuetype: Bug
assignee: gojira
reporter: gojira
assignee: GoJira
reporter: GoJira
blockers:
depends: $dup[Done]
priority: Medium
@@ -161,8 +161,8 @@ status: Backlog
summary: summary
project: KANBAN
issuetype: Bug
assignee: gojira
reporter: gojira
assignee: GoJira
reporter: GoJira
blockers: $blocker[Backlog]
depends: $dup[Done]
priority: Medium
@@ -207,8 +207,8 @@ status: Backlog
summary: summary
project: KANBAN
issuetype: Bug
assignee: gojira
reporter: gojira
assignee: GoJira
reporter: GoJira
blockers: $blocker[Backlog]
depends: $dup[Done]
priority: Medium
@@ -234,8 +234,8 @@ status: Backlog
summary: summary
project: KANBAN
issuetype: Bug
assignee: gojira
reporter: gojira
assignee: GoJira
reporter: GoJira
blockers: $blocker[Backlog]
depends: $dup[Done]
priority: Medium
@@ -254,10 +254,10 @@ OK $issue $ENDPOINT/browse/$issue
EOF
# FIXME we probably need a watchers command to wrap this?
RUNS sh -c "$jira req /rest/api/2/issue/$issue/watchers | jq -r .watchers[].name | sort"
RUNS sh -c "$jira req /rest/api/2/issue/$issue/watchers | jq -r .watchers[].displayName | sort"
DIFF <<EOF
gojira
mothra
GoJira
Mothra
EOF
###############################################################################
@@ -335,8 +335,8 @@ status: Backlog
summary: summary
project: KANBAN
issuetype: Bug
assignee: gojira
reporter: gojira
assignee: GoJira
reporter: GoJira
blockers: $blocker[Done]
depends: $dup[Done]
priority: Medium
@@ -362,8 +362,8 @@ status: Backlog
summary: summary
project: KANBAN
issuetype: Bug
assignee: gojira
reporter: gojira
assignee: GoJira
reporter: GoJira
blockers: $blocker[Done]
depends: $dup[Done]
priority: Medium
@@ -372,7 +372,7 @@ description: |
description
comments:
- | # mothra, a minute ago
- | # Mothra, a minute ago
Yo, Comment
EOF
@@ -394,8 +394,8 @@ status: Done
summary: blocks
project: KANBAN
issuetype: Bug
assignee: gojira
reporter: gojira
assignee: GoJira
reporter: GoJira
blockers:
depends: $issue[Backlog]
priority: Medium
@@ -422,8 +422,8 @@ status: Done
summary: blocks
project: KANBAN
issuetype: Bug
assignee: gojira
reporter: gojira
assignee: GoJira
reporter: GoJira
blockers:
depends: $issue[Backlog]
priority: Medium
@@ -450,8 +450,8 @@ status: Done
summary: blocks
project: KANBAN
issuetype: Bug
assignee: gojira
reporter: gojira
assignee: GoJira
reporter: GoJira
blockers:
depends: $issue[Backlog]
priority: Medium
@@ -478,8 +478,8 @@ status: Done
summary: blocks
project: KANBAN
issuetype: Bug
assignee: mothra
reporter: gojira
assignee: Mothra
reporter: GoJira
blockers:
depends: $issue[Backlog]
priority: Medium
@@ -506,8 +506,8 @@ status: Done
summary: blocks
project: KANBAN
issuetype: Bug
assignee: gojira
reporter: gojira
assignee: GoJira
reporter: GoJira
blockers:
depends: $issue[Backlog]
priority: Medium
+30 -30
View File
@@ -35,8 +35,8 @@ status: To Do
summary: summary
project: PROJECT
issuetype: Task
assignee: gojira
reporter: gojira
assignee: GoJira
reporter: GoJira
priority: Medium
votes: 0
description: |
@@ -114,8 +114,8 @@ status: To Do
summary: summary
project: PROJECT
issuetype: Task
assignee: gojira
reporter: gojira
assignee: GoJira
reporter: GoJira
blockers:
depends: $dup[Done]
priority: Medium
@@ -161,8 +161,8 @@ status: To Do
summary: summary
project: PROJECT
issuetype: Task
assignee: gojira
reporter: gojira
assignee: GoJira
reporter: GoJira
blockers: $blocker[To Do]
depends: $dup[Done]
priority: Medium
@@ -207,8 +207,8 @@ status: To Do
summary: summary
project: PROJECT
issuetype: Task
assignee: gojira
reporter: gojira
assignee: GoJira
reporter: GoJira
blockers: $blocker[To Do]
depends: $dup[Done]
priority: Medium
@@ -234,8 +234,8 @@ status: To Do
summary: summary
project: PROJECT
issuetype: Task
assignee: gojira
reporter: gojira
assignee: GoJira
reporter: GoJira
blockers: $blocker[To Do]
depends: $dup[Done]
priority: Medium
@@ -254,10 +254,10 @@ OK $issue $ENDPOINT/browse/$issue
EOF
# FIXME we probably need a watchers command to wrap this?
RUNS sh -c "$jira req /rest/api/2/issue/$issue/watchers | jq -r .watchers[].name | sort"
RUNS sh -c "$jira req /rest/api/2/issue/$issue/watchers | jq -r .watchers[].displayName | sort"
DIFF <<EOF
gojira
mothra
GoJira
Mothra
EOF
###############################################################################
@@ -296,8 +296,8 @@ status: In Progress
summary: blocks
project: PROJECT
issuetype: Task
assignee: mothra
reporter: gojira
assignee: Mothra
reporter: GoJira
blockers:
depends: $issue[To Do]
priority: Medium
@@ -337,8 +337,8 @@ status: To Do
summary: summary
project: PROJECT
issuetype: Task
assignee: gojira
reporter: gojira
assignee: GoJira
reporter: GoJira
blockers: $blocker[Done]
depends: $dup[Done]
priority: Medium
@@ -364,8 +364,8 @@ status: To Do
summary: summary
project: PROJECT
issuetype: Task
assignee: gojira
reporter: gojira
assignee: GoJira
reporter: GoJira
blockers: $blocker[Done]
depends: $dup[Done]
priority: Medium
@@ -374,7 +374,7 @@ description: |
description
comments:
- | # mothra, a minute ago
- | # Mothra, a minute ago
Yo, Comment
EOF
@@ -396,8 +396,8 @@ status: Done
summary: blocks
project: PROJECT
issuetype: Task
assignee: mothra
reporter: gojira
assignee: Mothra
reporter: GoJira
blockers:
depends: $issue[To Do]
priority: Medium
@@ -424,8 +424,8 @@ status: Done
summary: blocks
project: PROJECT
issuetype: Task
assignee: mothra
reporter: gojira
assignee: Mothra
reporter: GoJira
blockers:
depends: $issue[To Do]
priority: Medium
@@ -452,8 +452,8 @@ status: Done
summary: blocks
project: PROJECT
issuetype: Task
assignee: mothra
reporter: gojira
assignee: Mothra
reporter: GoJira
blockers:
depends: $issue[To Do]
priority: Medium
@@ -480,8 +480,8 @@ status: Done
summary: blocks
project: PROJECT
issuetype: Task
assignee: gojira
reporter: gojira
assignee: GoJira
reporter: GoJira
blockers:
depends: $issue[To Do]
priority: Medium
@@ -508,8 +508,8 @@ status: Done
summary: blocks
project: PROJECT
issuetype: Task
assignee: mothra
reporter: gojira
assignee: Mothra
reporter: GoJira
blockers:
depends: $issue[To Do]
priority: Medium
+32 -28
View File
@@ -10,6 +10,10 @@ PLAN 84
($jira ls --project PROCESS | awk -F: '{print $1}' | while read issue; do ../jira start $issue; done) | sed 's/^/# CLEANUP: /g'
($jira ls --project PROCESS | awk -F: '{print $1}' | while read issue; do ../jira stop $issue; done) | sed 's/^/# CLEANUP: /g'
# for any issues still remaining, they are stuck in "Under Review" status
($jira ls --project PROCESS | awk -F: '{print $1}' | while read issue; do ../jira transition --noedit -m "approve" "Approve" $issue; done) | sed 's/^/# CLEANUP: /g'
($jira ls --project PROCESS | awk -F: '{print $1}' | while read issue; do ../jira transition --noedit -m "done" "Done" $issue; done) | sed 's/^/# CLEANUP: /g'
# reset login
RUNS $jira logout
echo "gojira123" | RUNS $jira login
@@ -36,8 +40,8 @@ status: Open
summary: summary
project: PROCESS
issuetype: Task
assignee: gojira
reporter: gojira
assignee: GoJira
reporter: GoJira
priority: Medium
votes: 0
description: |
@@ -123,8 +127,8 @@ status: Open
summary: summary
project: PROCESS
issuetype: Task
assignee: gojira
reporter: gojira
assignee: GoJira
reporter: GoJira
blockers:
depends: $dup[Cancelled]
priority: Medium
@@ -170,8 +174,8 @@ status: Open
summary: summary
project: PROCESS
issuetype: Task
assignee: gojira
reporter: gojira
assignee: GoJira
reporter: GoJira
blockers: $blocker[Open]
depends: $dup[Cancelled]
priority: Medium
@@ -216,8 +220,8 @@ status: Open
summary: summary
project: PROCESS
issuetype: Task
assignee: gojira
reporter: gojira
assignee: GoJira
reporter: GoJira
blockers: $blocker[Open]
depends: $dup[Cancelled]
priority: Medium
@@ -243,8 +247,8 @@ status: Open
summary: summary
project: PROCESS
issuetype: Task
assignee: gojira
reporter: gojira
assignee: GoJira
reporter: GoJira
blockers: $blocker[Open]
depends: $dup[Cancelled]
priority: Medium
@@ -263,10 +267,10 @@ OK $issue $ENDPOINT/browse/$issue
EOF
# FIXME we probably need a watchers command to wrap this?
RUNS sh -c "$jira req /rest/api/2/issue/$issue/watchers | jq -r .watchers[].name | sort"
RUNS sh -c "$jira req /rest/api/2/issue/$issue/watchers | jq -r .watchers[].displayName | sort"
DIFF <<EOF
gojira
mothra
GoJira
Mothra
EOF
###############################################################################
@@ -328,8 +332,8 @@ status: Open
summary: summary
project: PROCESS
issuetype: Task
assignee: gojira
reporter: gojira
assignee: GoJira
reporter: GoJira
blockers: $blocker[Open]
depends: $dup[Cancelled]
priority: Medium
@@ -355,8 +359,8 @@ status: Open
summary: summary
project: PROCESS
issuetype: Task
assignee: gojira
reporter: gojira
assignee: GoJira
reporter: GoJira
blockers: $blocker[Open]
depends: $dup[Cancelled]
priority: Medium
@@ -365,7 +369,7 @@ description: |
description
comments:
- | # mothra, a minute ago
- | # Mothra, a minute ago
Yo, Comment
EOF
@@ -387,8 +391,8 @@ status: Open
summary: blocks
project: PROCESS
issuetype: Task
assignee: gojira
reporter: gojira
assignee: GoJira
reporter: GoJira
blockers:
depends: $issue[Open]
priority: Medium
@@ -415,8 +419,8 @@ status: Open
summary: blocks
project: PROCESS
issuetype: Task
assignee: gojira
reporter: gojira
assignee: GoJira
reporter: GoJira
blockers:
depends: $issue[Open]
priority: Medium
@@ -443,8 +447,8 @@ status: Open
summary: blocks
project: PROCESS
issuetype: Task
assignee: gojira
reporter: gojira
assignee: GoJira
reporter: GoJira
blockers:
depends: $issue[Open]
priority: Medium
@@ -471,8 +475,8 @@ status: Open
summary: blocks
project: PROCESS
issuetype: Task
assignee: mothra
reporter: gojira
assignee: Mothra
reporter: GoJira
blockers:
depends: $issue[Open]
priority: Medium
@@ -499,8 +503,8 @@ status: Open
summary: blocks
project: PROCESS
issuetype: Task
assignee: gojira
reporter: gojira
assignee: GoJira
reporter: GoJira
blockers:
depends: $issue[Open]
priority: Medium
+28 -28
View File
@@ -35,8 +35,8 @@ status: To Do
summary: summary
project: TASK
issuetype: Task
assignee: gojira
reporter: gojira
assignee: GoJira
reporter: GoJira
priority: Medium
votes: 0
description: |
@@ -116,8 +116,8 @@ status: To Do
summary: summary
project: TASK
issuetype: Task
assignee: gojira
reporter: gojira
assignee: GoJira
reporter: GoJira
blockers:
depends: $dup[Done]
priority: Medium
@@ -163,8 +163,8 @@ status: To Do
summary: summary
project: TASK
issuetype: Task
assignee: gojira
reporter: gojira
assignee: GoJira
reporter: GoJira
blockers: $blocker[To Do]
depends: $dup[Done]
priority: Medium
@@ -209,8 +209,8 @@ status: To Do
summary: summary
project: TASK
issuetype: Task
assignee: gojira
reporter: gojira
assignee: GoJira
reporter: GoJira
blockers: $blocker[To Do]
depends: $dup[Done]
priority: Medium
@@ -236,8 +236,8 @@ status: To Do
summary: summary
project: TASK
issuetype: Task
assignee: gojira
reporter: gojira
assignee: GoJira
reporter: GoJira
blockers: $blocker[To Do]
depends: $dup[Done]
priority: Medium
@@ -256,10 +256,10 @@ OK $issue $ENDPOINT/browse/$issue
EOF
# FIXME we probably need a watchers command to wrap this?
RUNS sh -c "$jira req /rest/api/2/issue/$issue/watchers | jq -r .watchers[].name | sort"
RUNS sh -c "$jira req /rest/api/2/issue/$issue/watchers | jq -r .watchers[].displayName | sort"
DIFF <<EOF
gojira
mothra
GoJira
Mothra
EOF
###############################################################################
@@ -321,8 +321,8 @@ status: To Do
summary: summary
project: TASK
issuetype: Task
assignee: gojira
reporter: gojira
assignee: GoJira
reporter: GoJira
blockers: $blocker[Done]
depends: $dup[Done]
priority: Medium
@@ -348,8 +348,8 @@ status: To Do
summary: summary
project: TASK
issuetype: Task
assignee: gojira
reporter: gojira
assignee: GoJira
reporter: GoJira
blockers: $blocker[Done]
depends: $dup[Done]
priority: Medium
@@ -358,7 +358,7 @@ description: |
description
comments:
- | # mothra, a minute ago
- | # Mothra, a minute ago
Yo, Comment
EOF
@@ -380,8 +380,8 @@ status: Done
summary: blocks
project: TASK
issuetype: Task
assignee: gojira
reporter: gojira
assignee: GoJira
reporter: GoJira
blockers:
depends: $issue[To Do]
priority: Medium
@@ -408,8 +408,8 @@ status: Done
summary: blocks
project: TASK
issuetype: Task
assignee: gojira
reporter: gojira
assignee: GoJira
reporter: GoJira
blockers:
depends: $issue[To Do]
priority: Medium
@@ -436,8 +436,8 @@ status: Done
summary: blocks
project: TASK
issuetype: Task
assignee: gojira
reporter: gojira
assignee: GoJira
reporter: GoJira
blockers:
depends: $issue[To Do]
priority: Medium
@@ -464,8 +464,8 @@ status: Done
summary: blocks
project: TASK
issuetype: Task
assignee: mothra
reporter: gojira
assignee: Mothra
reporter: GoJira
blockers:
depends: $issue[To Do]
priority: Medium
@@ -492,8 +492,8 @@ status: Done
summary: blocks
project: TASK
issuetype: Task
assignee: gojira
reporter: gojira
assignee: GoJira
reporter: GoJira
blockers:
depends: $issue[To Do]
priority: Medium
+40
View File
@@ -0,0 +1,40 @@
#!/bin/bash
#dist/github.com/go-jira/jira-darwin-amd64 dist/github.com/go-jira/jira-linux-amd64 dist/github.com/go-jira/jira-windows-amd64.exe
#dist/github.com/go-jira/jira-linux-386 dist/github.com/go-jira/jira-windows-386.exe
EXIT_CODE=0
function error() {
echo $1
EXIT_CODE=1
}
DIST_DIR="dist/github.com/go-jira"
out=`file ${DIST_DIR}/jira-darwin-amd64 2>&1`
if ! [[ "$out" =~ "Mach-O 64-bit" ]]; then
error "darwin/amd64 build not as expected: $out"
fi
out=`file ${DIST_DIR}/jira-linux-amd64 2>&1`
if ! [[ "$out" =~ "ELF 64-bit LSB executable, x86-64" ]]; then
error "linux/amd64 build not as expected: $out"
fi
out=`file ${DIST_DIR}/jira-linux-386 2>&1`
if ! [[ "$out" =~ "ELF 32-bit LSB executable, Intel 80386" ]]; then
error "linux/i386 build not as expected: $out"
fi
out=`file ${DIST_DIR}/jira-windows-amd64.exe 2>&1`
if ! [[ "$out" =~ "PE32+ executable (console) x86-64" ]]; then
error "windows/amd64 build not as expected: $out"
fi
out=`file ${DIST_DIR}/jira-windows-386.exe 2>&1`
if ! [[ "$out" =~ "PE32 executable (console) Intel 80386" ]]; then
error "windows/i386 build not as expected: $out"
fi
exit $EXIT_CODE
+9
View File
@@ -3,6 +3,9 @@ module github.com/go-jira/jira
go 1.12
require (
github.com/Masterminds/goutils v1.1.0 // indirect
github.com/Masterminds/semver v1.5.0 // indirect
github.com/Masterminds/sprig v2.21.0+incompatible
github.com/Netflix/go-expect v0.0.0-20180928190340-9d1f4485533b // indirect
github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc // indirect
github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf // indirect
@@ -12,8 +15,12 @@ require (
github.com/coryb/oreo v0.0.0-20180804211640-3e1b88fc08f1
github.com/davecgh/go-spew v1.1.0 // indirect
github.com/fatih/camelcase v1.0.0 // indirect
github.com/google/go-cmp v0.5.2
github.com/google/uuid v1.1.1 // indirect
github.com/guelfey/go.dbus v0.0.0-20131113121618-f6a3a2366cc3 // indirect
github.com/hinshun/vt10x v0.0.0-20180809195222-d55458df857c // indirect
github.com/huandu/xstrings v1.2.0 // indirect
github.com/imdario/mergo v0.3.7 // indirect
github.com/jinzhu/copier v0.0.0-20180308034124-7e38e58719c3
github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51
github.com/kr/pretty v0.1.0 // indirect
@@ -21,6 +28,8 @@ require (
github.com/mattn/go-colorable v0.0.9 // indirect
github.com/mattn/go-isatty v0.0.3 // indirect
github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b
github.com/mitchellh/go-wordwrap v1.0.1
github.com/olekukonko/tablewriter v0.0.3
github.com/pkg/browser v0.0.0-20170505125900-c90ca0c84f15
github.com/pkg/errors v0.8.0
github.com/pmezard/go-difflib v1.0.0 // indirect
+22 -2
View File
@@ -1,3 +1,9 @@
github.com/Masterminds/goutils v1.1.0 h1:zukEsf/1JZwCMgHiK3GZftabmxiCw4apj3a28RPBiVg=
github.com/Masterminds/goutils v1.1.0/go.mod h1:8cTjp+g8YejhMuvIA5y2vz3BpJxksy863GQaJW2MFNU=
github.com/Masterminds/semver v1.5.0 h1:H65muMkzWKEuNDnfl9d70GUjFniHKHRbFPGBuZ3QEww=
github.com/Masterminds/semver v1.5.0/go.mod h1:MB6lktGJrhw8PrUyiEoblNEGEQ+RzHPF078ddwwvV3Y=
github.com/Masterminds/sprig v2.21.0+incompatible h1:nPETddHHEG1ucL7H5t5T95IuWaDe5qB9ImEaztiXgRc=
github.com/Masterminds/sprig v2.21.0+incompatible/go.mod h1:y6hNFY5UBTIWBxnzTeuNhlNS5hqE0NB0E6fgfo2Br3o=
github.com/Netflix/go-expect v0.0.0-20180928190340-9d1f4485533b h1:sSQK05nvxs4UkgCJaxihteu+r+6ela3dNMm7NVmsS3c=
github.com/Netflix/go-expect v0.0.0-20180928190340-9d1f4485533b/go.mod h1:oX5x61PbNXchhh0oikYAH+4Pcfw5LKv21+Jnpr6r6Pc=
github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc h1:cAKDfWh5VpdgMhJosfJnn5/FoN2SRZ4p7fJNX58YPaU=
@@ -6,8 +12,6 @@ github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf h1:qet1QNfXsQxTZq
github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0=
github.com/cheekybits/genny v1.0.0 h1:uGGa4nei+j20rOSeDeP5Of12XVm7TGUd4dJA9RDitfE=
github.com/cheekybits/genny v1.0.0/go.mod h1:+tQajlRqAUrPI7DOSpB0XAqZYtQakVtB7wXkRAgjxjQ=
github.com/coryb/figtree v0.0.0-20180728224503-071d1ef303df h1:cS4Z9Nlv8J4UqFbLp9ltZypgenm2p3Jeg0yqLfpH2pc=
github.com/coryb/figtree v0.0.0-20180728224503-071d1ef303df/go.mod h1:uAkZUEGm6dROpxfy+8vXLs7JrLCI4O+gQyKAuISxI/g=
github.com/coryb/figtree v1.0.1-0.20190907170512-58176d03ef0d h1:99xxg8FYj+5TYg88DxA4xL8ODuI6OvuSu35WQOVPDPg=
github.com/coryb/figtree v1.0.1-0.20190907170512-58176d03ef0d/go.mod h1:uAkZUEGm6dROpxfy+8vXLs7JrLCI4O+gQyKAuISxI/g=
github.com/coryb/kingpeon v0.0.0-20180107011214-9a669f143f2e h1:tGmk9Tuyz7fKuBq/d3nFJvVWRvc48MEBKQC4uYV3wb0=
@@ -18,10 +22,18 @@ github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/fatih/camelcase v1.0.0 h1:hxNvNX/xYBp0ovncs8WyWZrOrpBNub/JfaMvbURyft8=
github.com/fatih/camelcase v1.0.0/go.mod h1:yN2Sb0lFhZJUdVvtELVWefmrXpuZESvPmqwoZc+/fpc=
github.com/google/go-cmp v0.5.2 h1:X2ev0eStA3AbceY54o37/0PQ/UWqKEiiO2dKL5OPaFM=
github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/uuid v1.1.1 h1:Gkbcsh/GbpXz7lPftLA3P6TYMwjCLYm83jiFQZF/3gY=
github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/guelfey/go.dbus v0.0.0-20131113121618-f6a3a2366cc3 h1:fngCxKbvZdctIsWj2hYijhAt4iK0JXSSA78B36xP0yI=
github.com/guelfey/go.dbus v0.0.0-20131113121618-f6a3a2366cc3/go.mod h1:0CNX5Cvi77WEH8llpfZ/ieuqyceb1cnO5//b5zzsnF8=
github.com/hinshun/vt10x v0.0.0-20180809195222-d55458df857c h1:kp3AxgXgDOmIJFR7bIwqFhwJ2qWar8tEQSE5XXhCfVk=
github.com/hinshun/vt10x v0.0.0-20180809195222-d55458df857c/go.mod h1:DqJ97dSdRW1W22yXSB90986pcOyQ7r45iio1KN2ez1A=
github.com/huandu/xstrings v1.2.0 h1:yPeWdRnmynF7p+lLYz0H2tthW9lqhMJrQV/U7yy4wX0=
github.com/huandu/xstrings v1.2.0/go.mod h1:DvyZB1rfVYsBIigL8HwpZgxHwXozlTgGqn63UyNX5k4=
github.com/imdario/mergo v0.3.7 h1:Y+UAYTZ7gDEuOfhxKWy+dvb5dRQ6rJjFSdX2HZY1/gI=
github.com/imdario/mergo v0.3.7/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA=
github.com/jinzhu/copier v0.0.0-20180308034124-7e38e58719c3 h1:sHsPfNMAG70QAvKbddQ0uScZCHQoZsT5NykGRCeeeIs=
github.com/jinzhu/copier v0.0.0-20180308034124-7e38e58719c3/go.mod h1:yL958EeXv8Ylng6IfnvG4oflryUi3vgA3xPs9hmII1s=
github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 h1:Z9n2FFNUXsshfwJMBgNA0RU6/i7WVaAegv3PtuIHPMs=
@@ -37,8 +49,14 @@ github.com/mattn/go-colorable v0.0.9 h1:UVL0vNpWh04HeJXV0KLcaT7r06gOH2l4OW6ddYRU
github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU=
github.com/mattn/go-isatty v0.0.3 h1:ns/ykhmWi7G9O+8a448SecJU3nSMBXJfqQkl0upE1jI=
github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4=
github.com/mattn/go-runewidth v0.0.6 h1:V2iyH+aX9C5fsYCpK60U8BYIvmhqxuOL3JZcqc1NB7k=
github.com/mattn/go-runewidth v0.0.6/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI=
github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b h1:j7+1HpAFS1zy5+Q4qx1fWh90gTKwiN4QCGoY9TWyyO4=
github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b/go.mod h1:01TrycV0kFyexm33Z7vhZRXopbI8J3TDReVlkTgMUxE=
github.com/mitchellh/go-wordwrap v1.0.1 h1:TLuKupo69TCn6TQSyGxwI1EblZZEsQ0vMlAFQflz0v0=
github.com/mitchellh/go-wordwrap v1.0.1/go.mod h1:R62XHJLzvMFRBbcrT7m7WgmE1eOyTSsCt+hzestvNj0=
github.com/olekukonko/tablewriter v0.0.3 h1:i0LBnzgiChAWHJYTQAZJDOgf8MNxAVYZJ2m63SIDimI=
github.com/olekukonko/tablewriter v0.0.3/go.mod h1:YZeBtGzYYEsCHp2LST/u/0NDwGkRoBtmn1cIWCJiS6M=
github.com/pkg/browser v0.0.0-20170505125900-c90ca0c84f15 h1:mrI+6Ae64Wjt+uahGe5we/sPS1sXjvfT3YjtawAVgps=
github.com/pkg/browser v0.0.0-20170505125900-c90ca0c84f15/go.mod h1:4OwLy04Bl9Ef3GJJCoec+30X3LQs/0/m4HFRt/2LUSA=
github.com/pkg/errors v0.8.0 h1:WdK/asTD0HN+q6hsWO3/vpuAkAr+tw6aNJNDFFf0+qw=
@@ -61,6 +79,8 @@ golang.org/x/net v0.0.0-20171102191033-01c190206fbd h1:CLQSRrSDQMOMkogMxky7XOkER
golang.org/x/net v0.0.0-20171102191033-01c190206fbd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/sys v0.0.0-20180727230415-bd9dbc187b6e h1:3dQ4fR8k5KugjVKO0oqSd1odxuk2yaE2CIfxWP2WarQ=
golang.org/x/sys v0.0.0-20180727230415-bd9dbc187b6e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
gopkg.in/AlecAivazis/survey.v1 v1.6.1 h1:HyWkjKGBpzhNxrpaKRLDqoa4L1f4cMVBNU4bnVmU8Mw=
gopkg.in/AlecAivazis/survey.v1 v1.6.1/go.mod h1:2Ehl7OqkBl3Xb8VmC4oFW2bItAhnUfzIjrOzwRxCrOU=
gopkg.in/alecthomas/kingpin.v2 v2.2.6 h1:jMFz6MfLP0/4fUyZle81rXUoxOBFi19VUFKVDOQfozc=
+64 -1
View File
@@ -109,6 +109,41 @@ func GetIssueWorklog(ua HttpClient, endpoint string, issue string) (*jiradata.Wo
return &worklogs, nil
}
func (j *Jira) GetIssueComment(issue string) (*jiradata.Comments, error) {
return GetIssueComment(j.UA, j.Endpoint, issue)
}
// https://docs.atlassian.com/software/jira/docs/api/REST/7.12.0/#api/2/issue-getComments
func GetIssueComment(ua HttpClient, endpoint string, issue string) (*jiradata.Comments, error) {
startAt := 0
total := 1
maxResults := 100
comments := jiradata.Comments{}
for startAt < total {
uri := URLJoin(endpoint, "rest/api/2/issue", issue, "comment")
uri += fmt.Sprintf("?startAt=%d&maxResults=%d", startAt, maxResults)
resp, err := ua.GetJSON(uri)
if err != nil {
return nil, err
}
defer resp.Body.Close()
if resp.StatusCode == 200 {
results := &jiradata.CommentsWithPagination{}
err := json.NewDecoder(resp.Body).Decode(results)
if err != nil {
return nil, err
}
startAt = startAt + maxResults
total = results.Total
comments = append(comments, results.Comments...)
} else {
return nil, responseError(resp)
}
}
return &comments, nil
}
type WorklogProvider interface {
ProvideWorklog() *jiradata.Worklog
}
@@ -464,7 +499,7 @@ func (j *Jira) IssueRemoveWatcher(issue, user string) error {
func IssueRemoveWatcher(ua HttpClient, endpoint string, issue, user string) error {
uri := URLJoin(endpoint, "rest/api/2/issue", issue, "watchers")
uri += fmt.Sprintf("?username=%s", user)
uri += fmt.Sprintf("?accountId=%s", user)
resp, err := ua.Delete(uri)
if err != nil {
return err
@@ -543,6 +578,34 @@ func IssueAssign(ua HttpClient, endpoint string, issue, name string) error {
return responseError(resp)
}
func IssueAssignAccountID(ua HttpClient, endpoint string, issue, acctId string) error {
// this is special, not using the jiradata.User structure
// because we need to be able to send `null` as the name param
// when we want to un-assign the issue
req := struct {
AccountID *string `json:"accountId"`
}{&acctId}
if acctId == "" {
req.AccountID = nil
}
encoded, err := json.Marshal(req)
if err != nil {
return err
}
uri := URLJoin(endpoint, "rest/api/2/issue", issue, "assignee")
resp, err := ua.Put(uri, "application/json", bytes.NewBuffer(encoded))
if err != nil {
return err
}
defer resp.Body.Close()
if resp.StatusCode == 204 {
return nil
}
return responseError(resp)
}
// https://docs.atlassian.com/jira/REST/cloud/#api/2/issue/{issueIdOrKey}/attachments-addAttachment
func (j *Jira) IssueAttachFile(issue, filename string, contents io.Reader) (*jiradata.ListOfAttachment, error) {
return IssueAttachFile(j.UA, j.Endpoint, issue, filename, contents)
+2 -1
View File
@@ -4,7 +4,8 @@ import (
"github.com/coryb/oreo"
)
const VERSION = "1.0.21"
// replace by ldflags
var VERSION = "development"
type Jira struct {
Endpoint string `json:"endpoint,omitempty" yaml:"endpoint,omitempty"`
+133 -3
View File
@@ -12,6 +12,7 @@ import (
"os/exec"
"reflect"
"runtime/debug"
"strconv"
"strings"
"github.com/coryb/figtree"
@@ -48,8 +49,14 @@ func HandleExit() {
}
}
const (
ServerDeploymentType = "server"
CloudDeploymentType = "cloud"
)
type GlobalOptions struct {
// AuthenticationMethod is the method we use to authenticate with the jira serivce. Possible values are "api-token" or "session".
// AuthenticationMethod is the method we use to authenticate with the jira serivce.
// Possible values are "api-token", "bearer-token" or "session".
// The default is "api-token" when the service endpoint ends with "atlassian.net", otherwise it "session". Session authentication
// will promt for user password and use the /auth/1/session-login endpoint.
AuthenticationMethod figtree.StringOption `yaml:"authentication-method,omitempty" json:"authentication-method,omitempty"`
@@ -71,6 +78,12 @@ type GlobalOptions struct {
// location using the `pass` tool, if missing prompt the user and store in the PasswordDirectory
PasswordSource figtree.StringOption `yaml:"password-source,omitempty" json:"password-source,omitempty"`
// PasswordSourcePath can be used to specify the path to the PasswordSource binary to use.
PasswordSourcePath figtree.StringOption `yaml:"password-source-path,omitempty" json:"password-source-path,omitempty"`
// Cached password to avoid invoking password source on each API request
cachedPassword string
// PasswordDirectory is only used for the "pass" PasswordSource. It is the location for the encrypted password
// files used by `pass`. Effectively this overrides the "PASSWORD_STORE_DIR" environment variable
PasswordDirectory figtree.StringOption `yaml:"password-directory,omitempty" json:"password-directory,omitempty"`
@@ -95,11 +108,16 @@ type GlobalOptions struct {
// `username` The User property is used on Jira service API calls that require a user to associate with
// an Issue (like assigning a Issue to yourself)
User figtree.StringOption `yaml:"user,omitempty" json:"user,omitempty"`
// JiraDeploymentType can be `cloud` or `server`, if not set it will be inferred from
// the /rest/api/2/serverInfo REST API.
JiraDeploymentType figtree.StringOption `yaml:"jira-deployment-type,omitempty" json:"jira-deployment-type,omitempty"`
}
type CommonOptions struct {
Browse figtree.BoolOption `yaml:"browse,omitempty" json:"browse,omitempty"`
Editor figtree.StringOption `yaml:"editor,omitempty" json:"editor,omitempty"`
File figtree.StringOption `yaml:"file,omitempty" json:"file,omitempty"`
GJsonQuery figtree.StringOption `yaml:"gjq,omitempty" json:"gjq,omitempty"`
SkipEditing figtree.BoolOption `yaml:"noedit,omitempty" json:"noedit,omitempty"`
Template figtree.StringOption `yaml:"template,omitempty" json:"template,omitempty"`
@@ -137,6 +155,10 @@ func (o *GlobalOptions) AuthMethod() string {
return o.AuthenticationMethod.Value
}
func (o *GlobalOptions) AuthMethodIsToken() bool{
return o.AuthMethod() == "api-token" || o.AuthMethod() == "bearer-token";
}
func register(app *kingpin.Application, o *oreo.Client, fig *figtree.FigTree) {
globals := GlobalOptions{
User: figtree.NewStringOption(os.Getenv("USER")),
@@ -156,6 +178,10 @@ func register(app *kingpin.Application, o *oreo.Client, fig *figtree.FigTree) {
token := globals.GetPass()
authHeader := fmt.Sprintf("Basic %s", base64.StdEncoding.EncodeToString([]byte(fmt.Sprintf("%s:%s", globals.Login.Value, token))))
req.Header.Add("Authorization", authHeader)
} else if globals.AuthMethod() == "bearer-token" {
token := globals.GetPass()
authHeader := fmt.Sprintf("Bearer %s", token)
req.Header.Add("Authorization", authHeader)
}
return req, nil
})
@@ -177,7 +203,7 @@ func register(app *kingpin.Application, o *oreo.Client, fig *figtree.FigTree) {
// rerun the original request
return o.Do(req)
}
} else if globals.AuthMethod() == "api-token" && resp.StatusCode == 401 {
} else if globals.AuthMethodIsToken() && resp.StatusCode == 401 {
globals.SetPass("")
return o.Do(req)
}
@@ -215,7 +241,7 @@ func register(app *kingpin.Application, o *oreo.Client, fig *figtree.FigTree) {
} else if globals.SocksProxy.Value != "" {
o = o.WithTransport(socksProxy(globals.SocksProxy.Value))
}
if globals.AuthMethod() == "api-token" {
if globals.AuthMethodIsToken() {
o = o.WithCookieFile("")
}
if globals.Login.Value == "" {
@@ -263,6 +289,10 @@ func EditorUsage(cmd *kingpin.CmdClause, opts *CommonOptions) {
cmd.Flag("editor", "Editor to use").SetValue(&opts.Editor)
}
func FileUsage(cmd *kingpin.CmdClause, opts *CommonOptions) {
cmd.Flag("file", "File to use").SetValue(&opts.File)
}
func TemplateUsage(cmd *kingpin.CmdClause, opts *CommonOptions) {
cmd.Flag("template", "Template to use for output").Short('t').SetValue(&opts.Template)
}
@@ -458,3 +488,103 @@ func EditLoop(opts *CommonOptions, input interface{}, output interface{}, submit
}
return nil
}
var FileAbort = fmt.Errorf("file processing aborted")
func ReadYmlInputFile(opts *CommonOptions, input interface{}, output interface{}, submit func() error) error {
tmpFile, err := tmpTemplate(opts.Template.Value, input)
if err != nil {
return err
}
tmpFile = opts.File.String()
// we need to copy the original output so that we can restore
// it on retries in case we try to populate bogus fields that
// are rejected by the jira service.
dup := reflect.New(reflect.ValueOf(output).Elem().Type())
err = copier.Copy(dup.Interface(), output)
if err != nil {
return err
}
// parse template
data, err := ioutil.ReadFile(tmpFile)
if err != nil {
return err
}
defer func(mapType, iface reflect.Type) {
yaml.DefaultMapType = mapType
yaml.IfaceType = iface
}(yaml.DefaultMapType, yaml.IfaceType)
yaml.DefaultMapType = reflect.TypeOf(map[string]interface{}{})
yaml.IfaceType = yaml.DefaultMapType.Elem()
// restore output incase of retry loop
err = copier.Copy(output, dup.Interface())
if err != nil {
return err
}
// HACK HACK HACK we want to trim out all the yaml garbage that is not
// poplulated, like empty arrays, string values with only a newline,
// etc. We need to do this because jira will reject json documents
// with empty arrays, or empty strings typically. So here we process
// the data to a raw interface{} then we fixup the yaml parsed
// interface, then we serialize to a new yaml document ... then is
// parsed as the original document to populate the output struct. Phew.
var raw interface{}
if err := yaml.Unmarshal(data, &raw); err != nil {
log.Error(err.Error())
fmt.Printf("Invalid YAML syntax\n")
return FileAbort
}
yamlFixup(&raw)
fixedYAML, err := yaml.Marshal(&raw)
if err != nil {
log.Error(err.Error())
fmt.Printf("Invalid YAML syntax\n")
return FileAbort
}
if err := yaml.Unmarshal(fixedYAML, output); err != nil {
log.Error(err.Error())
fmt.Printf("Invalid YAML syntax\n")
return FileAbort
}
// submit template
if err := submit(); err != nil {
log.Error(err.Error())
fmt.Printf("Jira reported an error\n")
return FileAbort
}
return nil
}
func FormatIssue(issueKey string, project string) string {
if issueKey == "" {
return ""
}
// expect PROJ-1234 issue format, this will split and
// reassemble, converting proj-1234 to PROJ-1234
parts := strings.SplitN(issueKey, "-", 2)
if len(parts) > 1 {
return fmt.Sprintf("%s-%s", strings.ToUpper(parts[0]), parts[1])
}
// if issue is not PROJ-1234 then it might just be 1234, so verify
// it is a number here otherwise warn and return input
if _, err := strconv.Atoi(issueKey); err != nil {
log.Warningf("Unexpected issue format %q, expected PROJ-1234", issueKey)
return issueKey
}
if project == "" {
log.Warningf("Using abbreviated issue %q but `project` property is not defined", issueKey)
return issueKey
}
return fmt.Sprintf("%s-%s", strings.ToUpper(project), issueKey)
}
+114 -31
View File
@@ -21,7 +21,7 @@ func (o *GlobalOptions) ProvideAuthParams() *jiradata.AuthParams {
func (o *GlobalOptions) keyName() string {
user := o.Login.Value
if o.AuthMethod() == "api-token" {
if o.AuthMethodIsToken() {
user = "api-token:" + user
}
@@ -31,56 +31,116 @@ func (o *GlobalOptions) keyName() string {
}
return fmt.Sprintf("GoJira/%s", user)
}
if o.PasswordSource.Value == "gopass" {
if o.PasswordName.Value != "" {
return o.PasswordName.Value
}
return fmt.Sprintf("GoJira/%s", user)
}
return user
}
func (o *GlobalOptions) GetPasswordPath() string {
// if no password source path then just default
// to the password source name
if o.PasswordSourcePath.Value == "" {
return o.PasswordSource.Value
}
return o.PasswordSourcePath.Value
}
func (o *GlobalOptions) GetPass() string {
passwd := ""
if o.cachedPassword != "" {
return o.cachedPassword
}
log.Debugf("Getting Password")
if o.PasswordSource.Value != "" {
log.Debugf("password-source: %s", o.PasswordSource)
if o.PasswordSource.Value == "keyring" {
log.Info("Querying keyring password source.")
var err error
passwd, err = keyringGet(o.keyName())
o.cachedPassword, err = keyringGet(o.keyName())
if err != nil {
panic(err)
}
} else if o.PasswordSource.Value == "pass" {
} else if o.PasswordSource.Value == "gopass" {
log.Debugf("Querying gopass password source.")
binary := o.GetPasswordPath()
if o.PasswordDirectory.Value != "" {
orig := os.Getenv("PASSWORD_STORE_DIR")
log.Debugf("using password-directory: %s", o.PasswordDirectory)
os.Setenv("PASSWORD_STORE_DIR", o.PasswordDirectory.Value)
defer os.Setenv("PASSWORD_STORE_DIR", orig)
}
if bin, err := exec.LookPath("pass"); err == nil {
if passDir := os.Getenv("PASSWORD_STORE_DIR"); passDir != "" {
log.Debugf("using PASSWORD_STORE_DIR=%s", passDir)
}
if bin, err := exec.LookPath(binary); err == nil {
log.Debugf("found gopass at: %s", bin)
buf := bytes.NewBufferString("")
cmd := exec.Command(bin, "show", "-o", o.keyName())
cmd.Stdout = buf
cmd.Stderr = os.Stderr
if err := cmd.Run(); err == nil {
o.cachedPassword = strings.TrimSpace(buf.String())
} else {
log.Warningf("gopass command failed with:\n%s", buf.String())
}
} else {
log.Warning("Gopass binary was not found! Fallback to default password behaviour!")
}
} else if o.PasswordSource.Value == "pass" {
log.Debugf("Querying pass password source.")
binary := o.GetPasswordPath()
if o.PasswordDirectory.Value != "" {
orig := os.Getenv("PASSWORD_STORE_DIR")
log.Debugf("using password-directory: %s", o.PasswordDirectory)
os.Setenv("PASSWORD_STORE_DIR", o.PasswordDirectory.Value)
defer os.Setenv("PASSWORD_STORE_DIR", orig)
}
if passDir := os.Getenv("PASSWORD_STORE_DIR"); passDir != "" {
log.Debugf("using PASSWORD_STORE_DIR=%s", passDir)
}
if bin, err := exec.LookPath(binary); err == nil {
log.Debugf("found pass at: %s", bin)
buf := bytes.NewBufferString("")
cmd := exec.Command(bin, o.keyName())
cmd.Stdout = buf
cmd.Stderr = buf
cmd.Stderr = os.Stderr
if err := cmd.Run(); err == nil {
passwd = strings.TrimSpace(buf.String())
o.cachedPassword = strings.TrimSpace(buf.String())
} else {
log.Warningf("pass command failed with:\n%s", buf.String())
}
} else {
log.Warning("pass binary was not found! Fallback to default password behaviour!")
}
} else if o.PasswordSource.Value == "stdin" {
log.Info("Reading password from stdin.")
allBytes, err := ioutil.ReadAll(os.Stdin)
if err != nil {
panic(fmt.Sprintf("unable to read bytes from stdin: %s", err))
}
passwd = string(allBytes)
o.cachedPassword = string(allBytes)
} else {
log.Warningf("Unknown password-source: %s", o.PasswordSource)
}
}
if passwd != "" {
return passwd
if o.cachedPassword != "" {
log.Info("Password cached.")
return o.cachedPassword
}
if passwd = os.Getenv("JIRA_API_TOKEN"); passwd != "" && o.AuthMethod() == "api-token" {
return passwd
if o.cachedPassword = os.Getenv("JIRA_API_TOKEN"); o.cachedPassword != "" && o.AuthMethodIsToken() {
return o.cachedPassword
}
prompt := fmt.Sprintf("Jira Password [%s]: ", o.Login)
help := ""
if o.AuthMethod() == "api-token" {
if o.AuthMethodIsToken() {
prompt = fmt.Sprintf("Jira API-Token [%s]: ", o.Login)
help = "API Tokens may be required by your Jira service endpoint: https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-basic-auth-and-cookie-based-auth/"
}
@@ -90,18 +150,23 @@ func (o *GlobalOptions) GetPass() string {
Message: prompt,
Help: help,
},
&passwd,
&o.cachedPassword,
nil,
)
if err != nil {
log.Errorf("%s", err)
panic(Exit{Code: 1})
}
o.SetPass(passwd)
return passwd
o.SetPass(o.cachedPassword)
return o.cachedPassword
}
func (o *GlobalOptions) SetPass(passwd string) error {
// dont reset password to empty string
if passwd == "" {
return nil
}
if o.PasswordSource.Value == "keyring" {
// save password in keychain so that it can be used for subsequent http requests
err := keyringSet(o.keyName(), passwd)
@@ -109,6 +174,29 @@ func (o *GlobalOptions) SetPass(passwd string) error {
log.Errorf("Failed to set password in keyring: %s", err)
return err
}
} else if o.PasswordSource.Value == "gopass" {
if o.PasswordDirectory.Value != "" {
orig := os.Getenv("PASSWORD_STORE_DIR")
os.Setenv("PASSWORD_STORE_DIR", o.PasswordDirectory.Value)
defer os.Setenv("PASSWORD_STORE_DIR", orig)
}
if bin, err := exec.LookPath("gopass"); err == nil {
log.Debugf("using %s", bin)
passName := o.keyName()
if passwd != "" {
in := bytes.NewBufferString(fmt.Sprintf("%s\n", passwd))
out := bytes.NewBufferString("")
cmd := exec.Command(bin, "insert", "--force", passName)
cmd.Stdin = in
cmd.Stdout = out
cmd.Stderr = out
if err := cmd.Run(); err != nil {
return fmt.Errorf("Failed to insert password: %s", out.String())
}
}
} else {
return fmt.Errorf("Gopass binary not found!")
}
} else if o.PasswordSource.Value == "pass" {
if o.PasswordDirectory.Value != "" {
orig := os.Getenv("PASSWORD_STORE_DIR")
@@ -118,22 +206,17 @@ func (o *GlobalOptions) SetPass(passwd string) error {
if bin, err := exec.LookPath("pass"); err == nil {
log.Debugf("using %s", bin)
passName := o.keyName()
if passwd != "" {
in := bytes.NewBufferString(fmt.Sprintf("%s\n%s\n", passwd, passwd))
out := bytes.NewBufferString("")
cmd := exec.Command(bin, "insert", "--force", passName)
cmd.Stdin = in
cmd.Stdout = out
cmd.Stderr = out
if err := cmd.Run(); err != nil {
return fmt.Errorf("Failed to insert password: %s", out.String())
}
} else {
// clear the `pass` entry on empty password
if err := exec.Command(bin, "rm", "--force", passName).Run(); err != nil {
return fmt.Errorf("Failed to clear password for %s", passName)
}
in := bytes.NewBufferString(fmt.Sprintf("%s\n%s\n", passwd, passwd))
out := bytes.NewBufferString("")
cmd := exec.Command(bin, "insert", "--force", passName)
cmd.Stdin = in
cmd.Stdout = out
cmd.Stderr = out
if err := cmd.Run(); err != nil {
return fmt.Errorf("Failed to insert password: %s", out.String())
}
} else {
return fmt.Errorf("Pass binary not found!")
}
} else if o.PasswordSource.Value != "" {
return fmt.Errorf("Unknown password-source: %s", o.PasswordSource)
+124 -41
View File
@@ -16,9 +16,12 @@ import (
yaml "gopkg.in/coryb/yaml.v2"
"github.com/Masterminds/sprig"
"github.com/coryb/figtree"
shellquote "github.com/kballard/go-shellquote"
"github.com/mgutz/ansi"
wordwrap "github.com/mitchellh/go-wordwrap"
"github.com/olekukonko/tablewriter"
"golang.org/x/crypto/ssh/terminal"
)
@@ -34,8 +37,8 @@ func findTemplate(name string) ([]byte, error) {
}
func getTemplate(name string) (string, error) {
if _, err := os.Stat(name); err == nil {
b, err := ioutil.ReadFile(name)
if _, err := os.Stat(".jira.d/" + name); err == nil {
b, err := ioutil.ReadFile(".jira.d/" + name)
if err != nil {
return "", err
}
@@ -76,6 +79,9 @@ func TemplateProcessor() *template.Template {
}
return out
},
"fit": func(size int, content string) string {
return fmt.Sprintf(fmt.Sprintf("%%-%d.%ds", size, size), content)
},
"shellquote": func(content string) string {
return shellquote.Join(content)
},
@@ -106,6 +112,9 @@ func TemplateProcessor() *template.Template {
}
return 120
},
"pctOf": func(size, percent int) int {
return int(float32(size) * (float32(percent) / 100))
},
"sub": func(a, b int) int {
return a - b
},
@@ -144,6 +153,9 @@ func TemplateProcessor() *template.Template {
"color": func(color string) string {
return ansi.ColorCode(color)
},
"remLineBreak": func(content string) string {
return strings.Replace(strings.Replace(content, string('\r'), string(' '), -1), string('\n'), string(' '), -1)
},
"regReplace": func(search string, replace string, content string) string {
re := regexp.MustCompile(search)
return re.ReplaceAllString(content, replace)
@@ -180,8 +192,11 @@ func TemplateProcessor() *template.Template {
"dateFormat": func(format string, content string) (string, error) {
return dateFormat(format, content)
},
"wrap": func(width uint, content string) string {
return wordwrap.WrapString(content, width)
},
}
return template.New("gojira").Funcs(funcs)
return template.New("gojira").Funcs(sprig.GenericFuncMap()).Funcs(funcs)
}
func ConfigTemplate(fig *figtree.FigTree, template, command string, opts interface{}) (string, error) {
@@ -243,13 +258,44 @@ func RunTemplate(templateName string, data interface{}, out io.Writer) error {
return err
}
tmpl, err := TemplateProcessor().Parse(templateContent)
table := tablewriter.NewWriter(out)
table.SetAutoFormatHeaders(false)
headers := []string{}
cells := [][]string{}
tmpl, err := TemplateProcessor().Funcs(map[string]interface{}{
"defaultColWidth": func(cw int) string {
table.SetColWidth(cw)
return ""
},
"headers": func(titles ...string) string {
headers = append(headers, titles...)
return ""
},
"row": func() string {
cells = append(cells, []string{})
return ""
},
"cell": func(value interface{}) (string, error) {
if len(cells) == 0 {
return "", fmt.Errorf(`"cell" template function called before "row" template function`)
}
cells[len(cells)-1] = append(cells[len(cells)-1], fmt.Sprintf("%v", value))
return "", nil
},
}).Parse(templateContent)
if err != nil {
return err
}
if err := tmpl.Execute(out, rawData); err != nil {
return err
}
if len(headers) > 0 || len(cells) > 0 {
table.SetHeader(headers)
table.AppendBulk(cells)
table.Render()
}
return nil
}
@@ -286,23 +332,42 @@ const defaultDebugTemplate = "{{ . | toJson}}\n"
const defaultListTemplate = "{{ range .issues }}{{ .key | append \":\" | printf \"%-12s\"}} {{ .fields.summary }}\n{{ end }}"
const defaultTableTemplate = `{{/* table template */ -}}
{{$w := sub termWidth 107 -}}
+{{ "-" | rep 16 }}+{{ "-" | rep $w }}+{{ "-" | rep 14 }}+{{ "-" | rep 14 }}+{{ "-" | rep 14 }}+{{ "-" | rep 12 }}+{{ "-" | rep 14 }}+{{ "-" | rep 14 }}+
| {{ "Issue" | printf "%-14s" }} | {{ "Summary" | printf (printf "%%-%ds" (sub $w 2)) }} | {{ "Type" | printf "%-12s"}} | {{ "Priority" | printf "%-12s" }} | {{ "Status" | printf "%-12s" }} | {{ "Age" | printf "%-10s" }} | {{ "Reporter" | printf "%-12s" }} | {{ "Assignee" | printf "%-12s" }} |
+{{ "-" | rep 16 }}+{{ "-" | rep $w }}+{{ "-" | rep 14 }}+{{ "-" | rep 14 }}+{{ "-" | rep 14 }}+{{ "-" | rep 12 }}+{{ "-" | rep 14 }}+{{ "-" | rep 14 }}+
{{ range .issues -}}
| {{ .key | printf "%-14s"}} | {{ .fields.summary | abbrev (sub $w 2) | printf (printf "%%-%ds" (sub $w 2)) }} | {{.fields.issuetype.name | printf "%-12s" }} | {{if .fields.priority}}{{.fields.priority.name | printf "%-12s" }}{{else}}<unassigned>{{end}} | {{.fields.status.name | printf "%-12s" }} | {{.fields.created | age | printf "%-10s" }} | {{if .fields.reporter}}{{ .fields.reporter.name | printf "%-12s"}}{{else}}<unassigned>{{end}} | {{if .fields.assignee }}{{.fields.assignee.name | printf "%-12s" }}{{else}}<unassigned>{{end}} |
{{ end -}}
+{{ "-" | rep 16 }}+{{ "-" | rep $w }}+{{ "-" | rep 14 }}+{{ "-" | rep 14 }}+{{ "-" | rep 14 }}+{{ "-" | rep 12 }}+{{ "-" | rep 14 }}+{{ "-" | rep 14 }}+
{{- headers "Issue" "Summary" "Type" "Priority" "Status" "Age" "Reporter" "Assignee" -}}
{{- range .issues -}}
{{- row -}}
{{- cell .key -}}
{{- cell .fields.summary -}}
{{- cell .fields.issuetype.name -}}
{{- if .fields.priority -}}
{{- cell .fields.priority.name -}}
{{- else -}}
{{- cell "<none>" -}}
{{- end -}}
{{- cell .fields.status.name -}}
{{- cell (.fields.created | age) -}}
{{- if .fields.reporter -}}
{{- cell .fields.reporter.displayName -}}
{{- else -}}
{{- cell "<unknown>" -}}
{{- end -}}
{{- if .fields.assignee -}}
{{- cell .fields.assignee.displayName -}}
{{- else -}}
{{- cell "<unassigned>" -}}
{{- end -}}
{{- end -}}
`
const defaultAttachListTemplate = `{{/* table template */ -}}
+{{ "-" | rep 12 }}+{{ "-" | rep 30 }}+{{ "-" | rep 12 }}+{{ "-" | rep 14 }}+{{ "-" | rep 14 }}+
| {{printf "%-10s" "id"}} | {{printf "%-28s" "filename"}} | {{printf "%-10s" "bytes"}} | {{printf "%-12s" "user"}} | {{printf "%-12s" "created"}} |
+{{ "-" | rep 12 }}+{{ "-" | rep 30 }}+{{ "-" | rep 12 }}+{{ "-" | rep 14 }}+{{ "-" | rep 14 }}+
{{range . -}}
| {{.id | printf "%10d" }} | {{.filename | printf "%-28s"}} | {{.size | printf "%10d"}} | {{.author.name | printf "%-12s"}} | {{.created | age | printf "%-12s"}} |
{{end -}}
+{{ "-" | rep 12 }}+{{ "-" | rep 30 }}+{{ "-" | rep 12 }}+{{ "-" | rep 14 }}+{{ "-" | rep 14 }}+
const defaultAttachListTemplate = `{{/* attach list template */ -}}
{{- headers "id" "filename" "bytes" "user" "created" -}}
{{- range . -}}
{{- row -}}
{{- cell .id -}}
{{- cell .filename -}}
{{- cell .size -}}
{{- cell .author.displayName -}}
{{- cell (.created | age) -}}
{{- end -}}
`
const defaultViewTemplate = `{{/* view template */ -}}
@@ -322,11 +387,11 @@ components: {{ range .fields.components }}{{ .name }} {{end}}
issuetype: {{ .fields.issuetype.name }}
{{end -}}
{{if .fields.assignee -}}
assignee: {{ .fields.assignee.name }}
assignee: {{ .fields.assignee.displayName }}
{{end -}}
reporter: {{ if .fields.reporter }}{{ .fields.reporter.name }}{{end}}
reporter: {{ if .fields.reporter }}{{ .fields.reporter.displayName }}{{end}}
{{if .fields.customfield_10110 -}}
watchers: {{ range .fields.customfield_10110 }}{{ .name }} {{end}}
watchers: {{ range .fields.customfield_10110 }}{{ .displayName }} {{end}}
{{end -}}
{{if .fields.issuelinks -}}
blockers: {{ range .fields.issuelinks }}{{if .outwardIssue}}{{ .outwardIssue.key }}[{{.outwardIssue.fields.status.name}}]{{end}}{{end}}
@@ -345,7 +410,7 @@ description: |
{{ or .fields.description "" | indent 2 }}
{{if .fields.comment.comments}}
comments:
{{ range .fields.comment.comments }} - | # {{.author.name}}, {{.created | age}} ago
{{ range .fields.comment.comments }} - | # {{.author.displayName}}, {{.created | age}} ago
{{ or .body "" | indent 4}}
{{end}}
{{end -}}
@@ -354,7 +419,7 @@ const defaultEditTemplate = `{{/* edit template */ -}}
# issue: {{ .key }} - created: {{ .fields.created | age}} ago
update:
comment:
- add:
- add:
body: |~
{{ or .overrides.comment "" | indent 10 }}
fields:
@@ -364,12 +429,18 @@ fields:
components: # Values: {{ range .meta.fields.components.allowedValues }}{{.name}}, {{end}}{{if .overrides.components }}{{ range (split "," .overrides.components)}}
- name: {{.}}{{end}}{{else}}{{ range .fields.components }}
- name: {{ .name }}{{end}}{{end}}{{end}}
{{- if .meta.fields.assignee}}
{{- if .meta.fields.assignee }}
{{- if .overrides.assignee }}
assignee:
name: {{ if .overrides.assignee }}{{.overrides.assignee}}{{else}}{{if .fields.assignee }}{{ .fields.assignee.name }}{{end}}{{end}}{{end}}
emailAddress: {{ .overrides.assignee }}
{{- else if .fields.assignee }}
assignee: {{if .fields.assignee.name}}
emailAddress: {{ or .fields.assignee.name}}
{{- else }}
emailAddress: {{.fields.assignee.emailAddress}}{{end}}{{end}}{{end}}
{{- if .meta.fields.reporter}}
reporter:
name: {{ if .overrides.reporter }}{{ .overrides.reporter }}{{else if .fields.reporter}}{{ .fields.reporter.name }}{{end}}{{end}}
emailAddress: {{ if .overrides.reporter }}{{ .overrides.reporter }}{{else if .fields.reporter}}{{ .fields.reporter.emailAddress }}{{end}}{{end}}
{{- if .meta.fields.customfield_10110}}
# watchers
customfield_10110: {{ range .fields.customfield_10110 }}
@@ -382,7 +453,7 @@ fields:
{{ or .overrides.description .fields.description "" | indent 4 }}
# votes: {{ .fields.votes.votes }}
# comments:
# {{ range .fields.comment.comments }} - | # {{.author.name}}, {{.created | age}} ago
# {{ range .fields.comment.comments }} - | # {{.author.displayName}}, {{.created | age}} ago
# {{ or .body "" | indent 4 | comment}}
# {{end}}
`
@@ -418,9 +489,9 @@ fields:
description: |~
{{ or .overrides.description "" | indent 4 }}{{if .meta.fields.assignee}}
assignee:
name: {{ or .overrides.assignee "" }}{{end}}{{if .meta.fields.reporter}}
emailAddress: {{ or .overrides.assignee "" }}{{end}}{{if .meta.fields.reporter}}
reporter:
name: {{ or .overrides.reporter .overrides.user }}{{end}}{{if .meta.fields.customfield_10110}}
emailAddress: {{ or .overrides.reporter .overrides.login }}{{end}}{{if .meta.fields.customfield_10110}}
# watchers
customfield_10110: {{ range split "," (or .overrides.watchers "")}}
- name: {{.}}{{end}}
@@ -441,9 +512,9 @@ fields:
description: |~
{{ or .overrides.description "" | indent 4 }}{{if .meta.fields.assignee}}
assignee:
name: {{ or .overrides.assignee "" }}{{end}}{{if .meta.fields.reporter}}
emailAddress: {{ or .overrides.assignee "" }}{{end}}{{if .meta.fields.reporter}}
reporter:
name: {{ or .overrides.reporter .overrides.user }}{{end}}{{if .meta.fields.customfield_10110}}
emailAddress: {{ or .overrides.reporter .overrides.login }}{{end}}{{if .meta.fields.customfield_10110}}
# watchers
customfield_10110: {{ range split "," (or .overrides.watchers "")}}
- name: {{.}}{{end}}
@@ -464,9 +535,9 @@ fields:
description: |~
{{ or .overrides.description "" | indent 4 }}{{if .meta.fields.assignee}}
assignee:
name: {{ or .overrides.assignee "" }}{{end}}{{if .meta.fields.reporter}}
emailAddress: {{ or .overrides.assignee "" }}{{end}}{{if .meta.fields.reporter}}
reporter:
name: {{ or .overrides.reporter .overrides.user }}{{end}}{{if .meta.fields.customfield_10110}}
emailAddress: {{ or .overrides.reporter .overrides.login }}{{end}}{{if .meta.fields.customfield_10110}}
# watchers
customfield_10110: {{ range split "," (or .overrides.watchers "")}}
- name: {{.}}{{end}}
@@ -484,14 +555,20 @@ const defaultTransitionTemplate = `{{/* transition template */ -}}
{{- if .meta.fields.comment }}
update:
comment:
- add:
- add:
body: |~
{{ or .overrides.comment "" | indent 10 }}
{{- end -}}
fields:
{{- if .meta.fields.assignee}}
{{- if .meta.fields.assignee }}
{{- if .overrides.assignee }}
assignee:
name: {{if .overrides.assignee}}{{.overrides.assignee}}{{else}}{{if .fields.assignee}}{{.fields.assignee.name}}{{end}}{{end}}
emailAddress: {{ .overrides.assignee }}
{{- else if .fields.assignee }}
assignee: {{if .fields.assignee.name}}
emailAddress: {{ or .fields.assignee.name}}
{{- else }}
emailAddress: {{.fields.assignee.emailAddress}}{{end}}{{end}}
{{- end -}}
{{if .meta.fields.components}}
components: # Values: {{ range .meta.fields.components.allowedValues }}{{.name}}, {{end}}{{if .overrides.components }}{{ range (split "," .overrides.components)}}
@@ -522,9 +599,15 @@ fields:
priority: # Values: {{ range .meta.fields.priority.allowedValues }}{{.name}}, {{end}}
name: {{ or .overrides.priority "unassigned" }}
{{- end -}}
{{if .meta.fields.reporter}}
{{- if .meta.fields.reporter }}
{{- if .overrides.reporter }}
reporter:
name: {{if .overrides.reporter}}{{.overrides.reporter}}{{else}}{{if .fields.reporter}}{{.fields.reporter.name}}{{end}}{{end}}
name: {{ .overrides.reporter }}
{{- else if .fields.reporter }}
reporter: {{if .fields.reporter.name}}
name: {{ or .fields.reporter.name}}
{{- else }}
displayName: {{.fields.reporter.displayName}}{{end}}{{end}}
{{- end -}}
{{if .meta.fields.resolution}}
resolution: # Values: {{ range .meta.fields.resolution.allowedValues }}{{.name}}, {{end}}
@@ -553,7 +636,7 @@ started: {{ or .started "" }}
`
const defaultWorklogsTemplate = `{{/* worklogs template */ -}}
{{ range .worklogs }}- # {{.author.name}}, {{.created | age}} ago
{{ range .worklogs }}- # {{.author.displayName}}, {{.created | age}} ago
comment: {{ or .comment "" }}
started: {{ .started }}
timeSpent: {{ .timeSpent }}
+2 -1
View File
@@ -103,6 +103,7 @@ Commands:
func CommandLine(fig *figtree.FigTree, o *oreo.Client) *kingpin.Application {
app := kingpin.New("jira", "Jira Command Line Interface")
app.HelpFlag.Short('h')
app.UsageWriter(os.Stdout)
app.ErrorWriter(os.Stderr)
app.Command("version", "Prints version").PreAction(func(*kingpin.ParseContext) error {
@@ -173,7 +174,7 @@ func ParseCommandLine(app *kingpin.Application, args []string) {
if ctx.SelectedCommand == nil {
next := ctx.Next()
if next != nil {
if ok, err := regexp.MatchString("^[A-Z]+-[0-9]+$", next.Value); err != nil {
if ok, err := regexp.MatchString("^([A-Z]+-)?[0-9]+$", next.Value); err != nil {
log.Errorf("Invalid Regex: %s", err)
} else if ok {
// insert "view" at i=1 (2nd position)
+31 -2
View File
@@ -2,6 +2,7 @@ package jiracmd
import (
"fmt"
"strings"
"github.com/coryb/figtree"
"github.com/coryb/oreo"
@@ -12,6 +13,7 @@ import (
type AssignOptions struct {
jiracli.CommonOptions `yaml:",inline" json:",inline" figtree:",inline"`
Project string `yaml:"project,omitempty" json:"project,omitempty"`
Issue string `yaml:"issue,omitempty" json:"issue,omitempty"`
Assignee string `yaml:"assignee,omitempty" json:"assignee,omitempty"`
}
@@ -26,6 +28,7 @@ func CmdAssignRegistry() *jiracli.CommandRegistryEntry {
return CmdAssignUsage(cmd, &opts)
},
func(o *oreo.Client, globals *jiracli.GlobalOptions) error {
opts.Issue = jiracli.FormatIssue(opts.Issue, opts.Project)
return CmdAssign(o, globals, &opts)
},
}
@@ -40,13 +43,39 @@ func CmdAssignUsage(cmd *kingpin.CmdClause, opts *AssignOptions) error {
return nil
}).Bool()
cmd.Arg("ISSUE", "issue to assign").Required().StringVar(&opts.Issue)
cmd.Arg("ASSIGNEE", "user to assign to issue").StringVar(&opts.Assignee)
cmd.Arg("ASSIGNEE", "email or display name of user to assign to issue").StringVar(&opts.Assignee)
return nil
}
// CmdAssign will assign an issue to a user
func CmdAssign(o *oreo.Client, globals *jiracli.GlobalOptions, opts *AssignOptions) error {
err := jira.IssueAssign(o, globals.Endpoint.Value, opts.Issue, opts.Assignee)
if globals.JiraDeploymentType.Value == "" {
serverInfo, err := jira.ServerInfo(o, globals.Endpoint.Value)
if err != nil {
return err
}
globals.JiraDeploymentType.Value = strings.ToLower(serverInfo.DeploymentType)
}
assignFunc := jira.IssueAssign
if globals.JiraDeploymentType.Value == jiracli.CloudDeploymentType {
if opts.Assignee != "" && opts.Assignee != "-1" {
users, err := jira.UserSearch(o, globals.Endpoint.Value, &jira.UserSearchOptions{
Query: opts.Assignee,
})
if err != nil {
return err
}
if len(users) > 1 {
return fmt.Errorf("Found %d accounts for users with username %q", len(users), opts.Assignee)
} else if len(users) == 1 {
opts.Assignee = users[0].AccountID
}
}
assignFunc = jira.IssueAssignAccountID
}
err := assignFunc(o, globals.Endpoint.Value, opts.Issue, opts.Assignee)
if err != nil {
return err
}
+2
View File
@@ -17,6 +17,7 @@ import (
type AttachCreateOptions struct {
jiracli.CommonOptions `yaml:",inline" json:",inline" figtree:",inline"`
Project string `yaml:"project,omitempty" json:"project,omitempty"`
Issue string `yaml:"issue,omitempty" json:"issue,omitempty"`
Attachment string `yaml:"attachment,omitempty" json:"attachment,omitempty"`
Filename string `yaml:"filename,omitempty" json:"filename,omitempty"`
@@ -33,6 +34,7 @@ func CmdAttachCreateRegistry() *jiracli.CommandRegistryEntry {
return CmdAttachCreateUsage(cmd, &opts)
},
func(o *oreo.Client, globals *jiracli.GlobalOptions) error {
opts.Issue = jiracli.FormatIssue(opts.Issue, opts.Project)
return CmdAttachCreate(o, globals, &opts)
},
}
+2
View File
@@ -13,6 +13,7 @@ import (
type AttachListOptions struct {
jiracli.CommonOptions `yaml:",inline" json:",inline" figtree:",inline"`
Project string `yaml:"project,omitempty" json:"project,omitempty"`
Issue string `yaml:"issue,omitempty" json:"issue,omitempty"`
}
@@ -30,6 +31,7 @@ func CmdAttachListRegistry() *jiracli.CommandRegistryEntry {
return CmdAttachListUsage(cmd, &opts)
},
func(o *oreo.Client, globals *jiracli.GlobalOptions) error {
opts.Issue = jiracli.FormatIssue(opts.Issue, opts.Project)
return CmdAttachList(o, globals, &opts)
},
}
+5 -2
View File
@@ -15,6 +15,7 @@ import (
type BlockOptions struct {
jiracli.CommonOptions `yaml:",inline" json:",inline" figtree:",inline"`
jiradata.LinkIssueRequest `yaml:",inline" json:",inline" figtree:",inline"`
Project string `yaml:"project,omitempty" json:"project,omitempty"`
}
func CmdBlockRegistry() *jiracli.CommandRegistryEntry {
@@ -38,6 +39,8 @@ func CmdBlockRegistry() *jiracli.CommandRegistryEntry {
return CmdBlockUsage(cmd, &opts)
},
func(o *oreo.Client, globals *jiracli.GlobalOptions) error {
opts.OutwardIssue.Key = jiracli.FormatIssue(opts.OutwardIssue.Key, opts.Project)
opts.InwardIssue.Key = jiracli.FormatIssue(opts.InwardIssue.Key, opts.Project)
return CmdBlock(o, globals, &opts)
},
}
@@ -53,8 +56,8 @@ func CmdBlockUsage(cmd *kingpin.CmdClause, opts *BlockOptions) error {
}
return nil
}).String()
cmd.Arg("BLOCKER", "blocker issue").Required().StringVar(&opts.OutwardIssue.Key)
cmd.Arg("ISSUE", "issue that is blocked").Required().StringVar(&opts.InwardIssue.Key)
cmd.Arg("ISSUE", "issue that is blocked").Required().StringVar(&opts.OutwardIssue.Key)
cmd.Arg("BLOCKER", "blocker issue").Required().StringVar(&opts.InwardIssue.Key)
return nil
}
+10 -3
View File
@@ -9,17 +9,24 @@ import (
kingpin "gopkg.in/alecthomas/kingpin.v2"
)
type BrowseOptions struct {
Project string `yaml:"project,omitempty" json:"project,omitempty"`
Issue string `yaml:"issue,omitempty" json:"issue,omitempty"`
}
func CmdBrowseRegistry() *jiracli.CommandRegistryEntry {
issue := ""
opts := BrowseOptions{}
return &jiracli.CommandRegistryEntry{
"Open issue in browser",
func(fig *figtree.FigTree, cmd *kingpin.CmdClause) error {
cmd.Arg("ISSUE", "Issue to browse to").Required().StringVar(&issue)
cmd.Arg("ISSUE", "Issue to browse to").Required().StringVar(&opts.Issue)
jiracli.LoadConfigs(cmd, fig, &opts)
return nil
},
func(o *oreo.Client, globals *jiracli.GlobalOptions) error {
return CmdBrowse(globals, issue)
opts.Issue = jiracli.FormatIssue(opts.Issue, opts.Project)
return CmdBrowse(globals, opts.Issue)
},
}
}
+2
View File
@@ -14,6 +14,7 @@ import (
type CommentOptions struct {
jiracli.CommonOptions `yaml:",inline" json:",inline" figtree:",inline"`
Project string `yaml:"project,omitempty" json:"project,omitempty"`
Overrides map[string]string `yaml:"overrides,omitempty" json:"overrides,omitempty"`
Issue string `yaml:"issue,omitempty" json:"issue,omitempty"`
}
@@ -33,6 +34,7 @@ func CmdCommentRegistry() *jiracli.CommandRegistryEntry {
return CmdCommentUsage(cmd, &opts)
},
func(o *oreo.Client, globals *jiracli.GlobalOptions) error {
opts.Issue = jiracli.FormatIssue(opts.Issue, opts.Project)
return CmdComment(o, globals, &opts)
},
}
+35 -5
View File
@@ -3,6 +3,7 @@ package jiracmd
import (
"fmt"
"os"
"strings"
"github.com/coryb/figtree"
"github.com/coryb/oreo"
@@ -18,6 +19,7 @@ type CreateOptions struct {
jiracli.CommonOptions `yaml:",inline" json:",inline" figtree:",inline"`
jiradata.IssueUpdate `yaml:",inline" json:",inline" figtree:",inline"`
Project string `yaml:"project,omitempty" json:"project,omitempty"`
Summary string `yaml:"summary,omitempty" json:"summary`
IssueType string `yaml:"issuetype,omitempty" json:"issuetype,omitempty"`
Overrides map[string]string `yaml:"overrides,omitempty" json:"overrides,omitempty"`
SaveFile string `yaml:"savefile,omitempty" json:"savefile,omitempty"`
@@ -46,9 +48,11 @@ func CmdCreateRegistry() *jiracli.CommandRegistryEntry {
func CmdCreateUsage(cmd *kingpin.CmdClause, opts *CreateOptions) error {
jiracli.BrowseUsage(cmd, &opts.CommonOptions)
jiracli.EditorUsage(cmd, &opts.CommonOptions)
jiracli.FileUsage(cmd, &opts.CommonOptions)
jiracli.TemplateUsage(cmd, &opts.CommonOptions)
cmd.Flag("noedit", "Disable opening the editor").SetValue(&opts.SkipEditing)
cmd.Flag("project", "project to create issue in").Short('p').StringVar(&opts.Project)
cmd.Flag("summary", "Summary of the issue").Short('s').StringVar(&opts.Summary)
cmd.Flag("issuetype", "issuetype in to create").Short('i').StringVar(&opts.IssueType)
cmd.Flag("comment", "Comment message for issue").Short('m').PreAction(func(ctx *kingpin.ParseContext) error {
opts.Overrides["comment"] = jiracli.FlagValue(ctx, "comment")
@@ -62,6 +66,14 @@ func CmdCreateUsage(cmd *kingpin.CmdClause, opts *CreateOptions) error {
// CmdCreate sends the create-metadata to the "create" template for editing, then
// will parse the edited document as YAML and submit the document to jira.
func CmdCreate(o *oreo.Client, globals *jiracli.GlobalOptions, opts *CreateOptions) error {
if globals.JiraDeploymentType.Value == "" {
serverInfo, err := jira.ServerInfo(o, globals.Endpoint.Value)
if err != nil {
return err
}
globals.JiraDeploymentType.Value = strings.ToLower(serverInfo.DeploymentType)
}
type templateInput struct {
Meta *jiradata.IssueType `yaml:"meta" json:"meta"`
Overrides map[string]string `yaml:"overrides" json:"overrides"`
@@ -81,14 +93,32 @@ func CmdCreate(o *oreo.Client, globals *jiracli.GlobalOptions, opts *CreateOptio
Overrides: opts.Overrides,
}
input.Overrides["project"] = opts.Project
if opts.Summary != "" {
input.Overrides["summary"] = opts.Summary
}
input.Overrides["issuetype"] = opts.IssueType
input.Overrides["user"] = globals.User.Value
input.Overrides["login"] = globals.Login.Value
var issueResp *jiradata.IssueCreateResponse
err = jiracli.EditLoop(&opts.CommonOptions, &input, &issueUpdate, func() error {
issueResp, err = jira.CreateIssue(o, globals.Endpoint.Value, &issueUpdate)
return err
})
var fnameOptsFile string
fnameOptsFile = opts.File.String()
if fnameOptsFile != "" {
err = jiracli.ReadYmlInputFile(&opts.CommonOptions, &input, &issueUpdate, func() error {
issueResp, err = jira.CreateIssue(o, globals.Endpoint.Value, &issueUpdate)
return err
})
} else {
err = jiracli.EditLoop(&opts.CommonOptions, &input, &issueUpdate, func() error {
if globals.JiraDeploymentType.Value == jiracli.CloudDeploymentType {
err := fixGDPRUserFields(o, globals.Endpoint.Value, createMeta.Fields, issueUpdate.Fields)
if err != nil {
return err
}
}
issueResp, err = jira.CreateIssue(o, globals.Endpoint.Value, &issueUpdate)
return err
})
}
if err != nil {
return err
}
+3 -2
View File
@@ -15,8 +15,7 @@ import (
type DupOptions struct {
jiracli.CommonOptions `yaml:",inline" json:",inline" figtree:",inline"`
jiradata.LinkIssueRequest `yaml:",inline" json:",inline" figtree:",inline"`
Duplicate string `yaml:"duplicate,omitempty" json:"duplicate,omitempty"`
Issue string `yaml:"issue,omitempty" json:"issue,omitempty"`
Project string `yaml:"project,omitempty" json:"project,omitempty"`
}
func CmdDupRegistry() *jiracli.CommandRegistryEntry {
@@ -40,6 +39,8 @@ func CmdDupRegistry() *jiracli.CommandRegistryEntry {
return CmdDupUsage(cmd, &opts)
},
func(o *oreo.Client, globals *jiracli.GlobalOptions) error {
opts.OutwardIssue.Key = jiracli.FormatIssue(opts.OutwardIssue.Key, opts.Project)
opts.InwardIssue.Key = jiracli.FormatIssue(opts.InwardIssue.Key, opts.Project)
return CmdDup(o, globals, &opts)
},
}
+95
View File
@@ -2,6 +2,7 @@ package jiracmd
import (
"fmt"
"strings"
"github.com/coryb/figtree"
"github.com/coryb/oreo"
@@ -36,6 +37,7 @@ func CmdEditRegistry() *jiracli.CommandRegistryEntry {
return CmdEditUsage(cmd, &opts, fig)
},
func(o *oreo.Client, globals *jiracli.GlobalOptions) error {
opts.Issue = jiracli.FormatIssue(opts.Issue, opts.Project)
if opts.QueryFields == "" {
opts.QueryFields = "assignee,created,priority,reporter,status,summary,updated,issuetype,comment,description,votes,created,customfield_10110,components"
}
@@ -70,6 +72,14 @@ func CmdEditUsage(cmd *kingpin.CmdClause, opts *EditOptions, fig *figtree.FigTre
// Edit will get issue data and send to "edit" template
func CmdEdit(o *oreo.Client, globals *jiracli.GlobalOptions, opts *EditOptions) error {
if globals.JiraDeploymentType.Value == "" {
serverInfo, err := jira.ServerInfo(o, globals.Endpoint.Value)
if err != nil {
return err
}
globals.JiraDeploymentType.Value = strings.ToLower(serverInfo.DeploymentType)
}
type templateInput struct {
*jiradata.Issue `yaml:",inline"`
Meta *jiradata.EditMeta `yaml:"meta" json:"meta"`
@@ -92,6 +102,12 @@ func CmdEdit(o *oreo.Client, globals *jiracli.GlobalOptions, opts *EditOptions)
Overrides: opts.Overrides,
}
err = jiracli.EditLoop(&opts.CommonOptions, &input, &issueUpdate, func() error {
if globals.JiraDeploymentType.Value == jiracli.CloudDeploymentType {
err := fixGDPRUserFields(o, globals.Endpoint.Value, editMeta.Fields, issueUpdate.Fields)
if err != nil {
return err
}
}
return jira.EditIssue(o, globals.Endpoint.Value, opts.Issue, &issueUpdate)
})
if err != nil {
@@ -122,6 +138,12 @@ func CmdEdit(o *oreo.Client, globals *jiracli.GlobalOptions, opts *EditOptions)
Overrides: opts.Overrides,
}
err = jiracli.EditLoop(&opts.CommonOptions, &input, &issueUpdate, func() error {
if globals.JiraDeploymentType.Value == jiracli.CloudDeploymentType {
err := fixGDPRUserFields(o, globals.Endpoint.Value, editMeta.Fields, issueUpdate.Fields)
if err != nil {
return err
}
}
return jira.EditIssue(o, globals.Endpoint.Value, issueData.Key, &issueUpdate)
})
if err == jiracli.EditLoopAbort && len(results.Issues) > i+1 {
@@ -151,3 +173,76 @@ func CmdEdit(o *oreo.Client, globals *jiracli.GlobalOptions, opts *EditOptions)
}
return nil
}
func fixUserField(ua jira.HttpClient, endpoint string, userField map[string]interface{}) error {
if _, ok := userField["accountId"].(string); ok {
// this field is already GDPR ready
return nil
}
queryName, ok := userField["displayName"].(string)
if !ok {
queryName, ok = userField["emailAddress"].(string)
if !ok {
// no fields to search on, skip user lookup
return nil
}
}
users, err := jira.UserSearch(ua, endpoint, &jira.UserSearchOptions{
// Query field will search users displayName and emailAddress
Query: queryName,
})
if err != nil {
return err
}
if len(users) != 1 {
return fmt.Errorf("Found %d accounts for users with query %q", len(users), queryName)
}
userField["accountId"] = users[0].AccountID
return nil
}
func fixGDPRUserFields(ua jira.HttpClient, endpoint string, meta jiradata.FieldMetaMap, fields map[string]interface{}) error {
for fieldName, fieldMeta := range meta {
// check to see if meta-field is in fields data, otherwise skip
if _, ok := fields[fieldName]; !ok {
continue
}
if fieldMeta.Schema.Type == "user" {
userField, ok := fields[fieldName].(map[string]interface{})
if !ok {
// for some reason the field seems to be the wrong type in the data
// even though the schema is a "user"
continue
}
err := fixUserField(ua, endpoint, userField)
if err != nil {
return err
}
fields[fieldName] = userField
}
if fieldMeta.Schema.Type == "array" && fieldMeta.Schema.Items == "user" {
listUserField, ok := fields[fieldName].([]interface{})
if !ok {
// for some reason the field seems to be the wrong type in the data
// even though the schema is a list of "user"
continue
}
for i, userFieldItem := range listUserField {
userField, ok := userFieldItem.(map[string]interface{})
if !ok {
// for some reason the field seems to be the wrong type in the data
// even though the schema is a "user"
continue
}
err := fixUserField(ua, endpoint, userField)
if err != nil {
return err
}
listUserField[i] = userField
}
fields[fieldName] = listUserField
}
}
return nil
}
+2
View File
@@ -10,6 +10,7 @@ import (
type EditMetaOptions struct {
jiracli.CommonOptions `yaml:",inline" json:",inline" figtree:",inline"`
Project string `yaml:"project,omitempty" json:"project,omitempty"`
Issue string `yaml:"issue,omitempty" json:"issue,omitempty"`
}
@@ -28,6 +29,7 @@ func CmdEditMetaRegistry() *jiracli.CommandRegistryEntry {
return CmdEditMetaUsage(cmd, &opts)
},
func(o *oreo.Client, globals *jiracli.GlobalOptions) error {
opts.Issue = jiracli.FormatIssue(opts.Issue, opts.Project)
return CmdEditMeta(o, globals, &opts)
},
}
+5
View File
@@ -14,6 +14,7 @@ import (
type EpicAddOptions struct {
jiradata.EpicIssues `yaml:",inline" json:",inline" figtree:",inline"`
Project string `yaml:"project,omitempty" json:"project,omitempty"`
Epic string `yaml:"epic,omitempty" json:"epic,omitempty"`
}
@@ -27,6 +28,10 @@ func CmdEpicAddRegistry() *jiracli.CommandRegistryEntry {
return CmdEpicAddUsage(cmd, &opts)
},
func(o *oreo.Client, globals *jiracli.GlobalOptions) error {
opts.Epic = jiracli.FormatIssue(opts.Epic, opts.Project)
for i := range opts.Issues {
opts.Issues[i] = jiracli.FormatIssue(opts.Issues[i], opts.Project)
}
return CmdEpicAdd(o, globals, &opts)
},
}
+1
View File
@@ -29,6 +29,7 @@ func CmdEpicListRegistry() *jiracli.CommandRegistryEntry {
return CmdEpicListUsage(cmd, &opts, fig)
},
func(o *oreo.Client, globals *jiracli.GlobalOptions) error {
opts.Epic = jiracli.FormatIssue(opts.Epic, opts.Project)
if opts.MaxResults == 0 {
opts.MaxResults = 500
}
+4
View File
@@ -14,6 +14,7 @@ import (
type EpicRemoveOptions struct {
jiradata.EpicIssues `yaml:",inline" json:",inline" figtree:",inline"`
Project string `yaml:"project,omitempty" json:"project,omitempty"`
}
func CmdEpicRemoveRegistry() *jiracli.CommandRegistryEntry {
@@ -26,6 +27,9 @@ func CmdEpicRemoveRegistry() *jiracli.CommandRegistryEntry {
return CmdEpicRemoveUsage(cmd, &opts)
},
func(o *oreo.Client, globals *jiracli.GlobalOptions) error {
for i := range opts.Issues {
opts.Issues[i] = jiracli.FormatIssue(opts.Issues[i], opts.Project)
}
return CmdEpicRemove(o, globals, &opts)
},
}
+3
View File
@@ -16,6 +16,7 @@ type IssueLinkOptions struct {
jiracli.CommonOptions `yaml:",inline" json:",inline" figtree:",inline"`
jiradata.LinkIssueRequest `yaml:",inline" json:",inline" figtree:",inline"`
LinkType string `yaml:"linktype,omitempty" json:"linktype,omitempty"`
Project string `yaml:"project,omitempty" json:"project,omitempty"`
}
func CmdIssueLinkRegistry() *jiracli.CommandRegistryEntry {
@@ -33,6 +34,8 @@ func CmdIssueLinkRegistry() *jiracli.CommandRegistryEntry {
return CmdIssueLinkUsage(cmd, &opts)
},
func(o *oreo.Client, globals *jiracli.GlobalOptions) error {
opts.OutwardIssue.Key = jiracli.FormatIssue(opts.OutwardIssue.Key, opts.Project)
opts.InwardIssue.Key = jiracli.FormatIssue(opts.InwardIssue.Key, opts.Project)
return CmdIssueLink(o, globals, &opts)
},
}
+2
View File
@@ -14,6 +14,7 @@ import (
type LabelsAddOptions struct {
jiracli.CommonOptions `yaml:",inline" json:",inline" figtree:",inline"`
Project string `yaml:"project,omitempty" json:"project,omitempty"`
Issue string `yaml:"issue,omitempty" json:"issue,omitempty"`
Labels []string `yaml:"labels,omitempty" json:"labels,omitempty"`
}
@@ -27,6 +28,7 @@ func CmdLabelsAddRegistry() *jiracli.CommandRegistryEntry {
return CmdLabelsAddUsage(cmd, &opts)
},
func(o *oreo.Client, globals *jiracli.GlobalOptions) error {
opts.Issue = jiracli.FormatIssue(opts.Issue, opts.Project)
return CmdLabelsAdd(o, globals, &opts)
},
}
+2
View File
@@ -14,6 +14,7 @@ import (
type LabelsRemoveOptions struct {
jiracli.CommonOptions `yaml:",inline" json:",inline" figtree:",inline"`
Project string `yaml:"project,omitempty" json:"project,omitempty"`
Issue string `yaml:"issue,omitempty" json:"issue,omitempty"`
Labels []string `yaml:"labels,omitempty" json:"labels,omitempty"`
}
@@ -27,6 +28,7 @@ func CmdLabelsRemoveRegistry() *jiracli.CommandRegistryEntry {
return CmdLabelsRemoveUsage(cmd, &opts)
},
func(o *oreo.Client, globals *jiracli.GlobalOptions) error {
opts.Issue = jiracli.FormatIssue(opts.Issue, opts.Project)
return CmdLabelsRemove(o, globals, &opts)
},
}
+2
View File
@@ -14,6 +14,7 @@ import (
type LabelsSetOptions struct {
jiracli.CommonOptions `yaml:",inline" json:",inline" figtree:",inline"`
Project string `yaml:"project,omitempty" json:"project,omitempty"`
Issue string `yaml:"issue,omitempty" json:"issue,omitempty"`
Labels []string `yaml:"labels,omitempty" json:"labels,omitempty"`
}
@@ -27,6 +28,7 @@ func CmdLabelsSetRegistry() *jiracli.CommandRegistryEntry {
return CmdLabelsSetUsage(cmd, &opts)
},
func(o *oreo.Client, globals *jiracli.GlobalOptions) error {
opts.Issue = jiracli.FormatIssue(opts.Issue, opts.Project)
return CmdLabelsSet(o, globals, &opts)
},
}
+18 -19
View File
@@ -50,27 +50,26 @@ func CmdLogin(o *oreo.Client, globals *jiracli.GlobalOptions, opts *jiracli.Comm
log.Noticef("No need to login when using api-token authentication method")
return nil
}
if globals.AuthMethod() == "bearer-token" {
log.Noticef("No need to login when using bearer-token authentication method")
return nil
}
ua := o.WithoutRedirect().WithRetries(0).WithoutCallbacks().WithPostCallback(authCallback)
for {
if session, err := jira.GetSession(o, globals.Endpoint.Value); err != nil {
// No active session so try to create a new one
_, err := jira.NewSession(ua, globals.Endpoint.Value, globals)
if err != nil {
// reset password on failed session
globals.SetPass("")
log.Errorf("%s", err)
continue
}
if !globals.Quiet.Value {
fmt.Println(ansi.Color("OK", "green"), "New session for", globals.User)
}
break
} else {
if !globals.Quiet.Value {
fmt.Println(ansi.Color("OK", "green"), "Found session for", session.Name)
}
break
if session, err := jira.GetSession(o, globals.Endpoint.Value); err != nil {
// No active session so try to create a new one
_, err := jira.NewSession(ua, globals.Endpoint.Value, globals)
if err != nil {
// reset password on failed session
globals.SetPass("")
log.Errorf("%s", err)
} else if !globals.Quiet.Value {
fmt.Println(ansi.Color("OK", "green"), "New session for", globals.User)
}
} else {
if !globals.Quiet.Value {
fmt.Println(ansi.Color("OK", "green"), "Found session for", session.Name)
}
}
return nil
+3 -3
View File
@@ -30,13 +30,13 @@ func CmdLogoutRegistry() *jiracli.CommandRegistryEntry {
// CmdLogout will attempt to terminate an active Jira session
func CmdLogout(o *oreo.Client, globals *jiracli.GlobalOptions, opts *jiracli.CommonOptions) error {
if globals.AuthMethod() == "api-token" {
log.Noticef("No need to logout when using api-token authentication method")
if globals.AuthMethodIsToken() {
log.Noticef("No need to logout when using api-token or bearer-token authentication method")
if globals.GetPass() != "" && terminal.IsTerminal(int(os.Stdin.Fd())) && terminal.IsTerminal(int(os.Stdout.Fd())) {
delete := false
err := survey.AskOne(
&survey.Confirm{
Message: fmt.Sprintf("Delete api-token from password provider [%s]: ", globals.PasswordSource),
Message: fmt.Sprintf("Delete token from password provider [%s]: ", globals.PasswordSource),
Default: false,
},
&delete,
+4 -1
View File
@@ -14,6 +14,7 @@ import (
type RankOptions struct {
jiracli.CommonOptions `yaml:",inline" json:",inline" figtree:",inline"`
Project string `yaml:"project,omitempty" json:"project,omitempty"`
First string `yaml:"first,omitempty" json:"first,omitempty"`
Second string `yaml:"second,omitempty" json:"second,omitempty"`
Order string `yaml:"order,omitempty" json:"order,omitempty"`
@@ -23,12 +24,14 @@ func CmdRankRegistry() *jiracli.CommandRegistryEntry {
opts := RankOptions{}
return &jiracli.CommandRegistryEntry{
"Mark issues as blocker",
"Change ranking of issue",
func(fig *figtree.FigTree, cmd *kingpin.CmdClause) error {
jiracli.LoadConfigs(cmd, fig, &opts)
return CmdRankUsage(cmd, &opts)
},
func(o *oreo.Client, globals *jiracli.GlobalOptions) error {
opts.First = jiracli.FormatIssue(opts.First, opts.Project)
opts.Second = jiracli.FormatIssue(opts.Second, opts.Project)
return CmdRank(o, globals, &opts)
},
}
+14 -2
View File
@@ -3,12 +3,12 @@ package jiracmd
import (
"encoding/json"
"fmt"
"io/ioutil"
"net/url"
"strings"
"github.com/coryb/figtree"
"github.com/coryb/oreo"
"github.com/go-jira/jira/jiracli"
kingpin "gopkg.in/alecthomas/kingpin.v2"
)
@@ -72,10 +72,22 @@ func CmdRequest(o *oreo.Client, globals *jiracli.GlobalOptions, opts *RequestOpt
if err != nil {
return err
}
if resp.Body == nil {
return fmt.Errorf("Empty Response Body")
}
defer resp.Body.Close()
bodyBytes, err := ioutil.ReadAll(resp.Body)
if err != nil {
return fmt.Errorf("Response Body read Error: %v", err)
}
if len(bodyBytes) == 0 {
log.Info("Empty response for status %d", resp.StatusCode)
return nil
}
var data interface{}
if err := json.NewDecoder(resp.Body).Decode(&data); err != nil {
if err := json.Unmarshal(bodyBytes, &data); err != nil {
return fmt.Errorf("JSON Parse Error: %v", err)
}
return opts.PrintTemplate(&data)
+17 -1
View File
@@ -2,6 +2,7 @@ package jiracmd
import (
"fmt"
"strings"
"github.com/coryb/figtree"
"github.com/coryb/oreo"
@@ -36,6 +37,7 @@ func CmdSubtaskRegistry() *jiracli.CommandRegistryEntry {
return CmdSubtaskUsage(cmd, &opts)
},
func(o *oreo.Client, globals *jiracli.GlobalOptions) error {
opts.Issue = jiracli.FormatIssue(opts.Issue, opts.Project)
if opts.IssueType == "" {
opts.IssueType = "Sub-task"
}
@@ -62,6 +64,14 @@ func CmdSubtaskUsage(cmd *kingpin.CmdClause, opts *SubtaskOptions) error {
// CmdSubtask sends the subtask-metadata to the "subtask" template for editing, then
// will parse the edited document as YAML and submit the document to jira.
func CmdSubtask(o *oreo.Client, globals *jiracli.GlobalOptions, opts *SubtaskOptions) error {
if globals.JiraDeploymentType.Value == "" {
serverInfo, err := jira.ServerInfo(o, globals.Endpoint.Value)
if err != nil {
return err
}
globals.JiraDeploymentType.Value = strings.ToLower(serverInfo.DeploymentType)
}
type templateInput struct {
Meta *jiradata.IssueType `yaml:"meta" json:"meta"`
Overrides map[string]string `yaml:"overrides" json:"overrides"`
@@ -96,10 +106,16 @@ func CmdSubtask(o *oreo.Client, globals *jiracli.GlobalOptions, opts *SubtaskOpt
}
input.Overrides["project"] = opts.Project
input.Overrides["issuetype"] = opts.IssueType
input.Overrides["user"] = globals.User.Value
input.Overrides["login"] = globals.Login.Value
var issueResp *jiradata.IssueCreateResponse
err = jiracli.EditLoop(&opts.CommonOptions, &input, &issueUpdate, func() error {
if globals.JiraDeploymentType.Value == jiracli.CloudDeploymentType {
err := fixGDPRUserFields(o, globals.Endpoint.Value, createMeta.Fields, issueUpdate.Fields)
if err != nil {
return err
}
}
issueResp, err = jira.CreateIssue(o, globals.Endpoint.Value, &issueUpdate)
return err
})
+2 -1
View File
@@ -17,8 +17,9 @@ func CmdTakeRegistry() *jiracli.CommandRegistryEntry {
return CmdAssignUsage(cmd, &opts)
},
func(o *oreo.Client, globals *jiracli.GlobalOptions) error {
opts.Issue = jiracli.FormatIssue(opts.Issue, opts.Project)
if opts.Assignee == "" {
opts.Assignee = globals.User.Value
opts.Assignee = globals.Login.Value
}
return CmdAssign(o, globals, &opts)
},
+36
View File
@@ -15,6 +15,7 @@ import (
type TransitionOptions struct {
jiracli.CommonOptions `yaml:",inline" json:",inline" figtree:",inline"`
Project string `yaml:"project,omitempty" json:"project,omitempty"`
Overrides map[string]string `yaml:"overrides,omitempty" json:"overrides,omitempty"`
Transition string `yaml:"transition,omitempty" json:"transition,omitempty"`
Issue string `yaml:"issue,omitempty" json:"issue,omitempty"`
@@ -45,6 +46,7 @@ func CmdTransitionRegistry(transition string) *jiracli.CommandRegistryEntry {
return CmdTransitionUsage(cmd, &opts)
},
func(o *oreo.Client, globals *jiracli.GlobalOptions) error {
opts.Issue = jiracli.FormatIssue(opts.Issue, opts.Project)
return CmdTransition(o, globals, &opts)
},
}
@@ -84,6 +86,14 @@ func defaultResolution(transMeta *jiradata.Transition) string {
// CmdTransition will move state of the given issue to the given transtion
func CmdTransition(o *oreo.Client, globals *jiracli.GlobalOptions, opts *TransitionOptions) error {
if globals.JiraDeploymentType.Value == "" {
serverInfo, err := jira.ServerInfo(o, globals.Endpoint.Value)
if err != nil {
return err
}
globals.JiraDeploymentType.Value = strings.ToLower(serverInfo.DeploymentType)
}
issueData, err := jira.GetIssue(o, globals.Endpoint.Value, opts.Issue, nil)
if err != nil {
return jiracli.CliError(err)
@@ -149,6 +159,32 @@ func CmdTransition(o *oreo.Client, globals *jiracli.GlobalOptions, opts *Transit
Overrides: opts.Overrides,
}
err = jiracli.EditLoop(&opts.CommonOptions, &input, &issueUpdate, func() error {
if globals.JiraDeploymentType.Value == jiracli.CloudDeploymentType {
err := fixGDPRUserFields(o, globals.Endpoint.Value, transMeta.Fields, issueUpdate.Fields)
if err != nil {
return err
}
}
// if issueUpdate contains fields lets see if we can map them
// to their ids
if len(issueUpdate.Fields) > 0 {
fields, err := jira.GetFields(o, globals.Endpoint.Value)
if err != nil {
return err
}
for k, v := range issueUpdate.Fields {
for _, f := range fields {
if f.Name == k {
// re-map to field.id
issueUpdate.Fields[f.ID] = v
delete(issueUpdate.Fields, k)
break
}
}
}
}
return jira.TransitionIssue(o, globals.Endpoint.Value, opts.Issue, &issueUpdate)
})
if err != nil {
+2
View File
@@ -10,6 +10,7 @@ import (
type TransitionsOptions struct {
jiracli.CommonOptions `yaml:",inline" json:",inline" figtree:",inline"`
Project string `yaml:"project,omitempty" json:"project,omitempty"`
Issue string `yaml:"issue,omitempty" json:"issue,omitempty"`
}
@@ -27,6 +28,7 @@ func CmdTransitionsRegistry(defaultTemplate string) *jiracli.CommandRegistryEntr
return CmdTransitionsUsage(cmd, &opts)
},
func(o *oreo.Client, globals *jiracli.GlobalOptions) error {
opts.Issue = jiracli.FormatIssue(opts.Issue, opts.Project)
return CmdTransitions(o, globals, &opts)
},
}
+1
View File
@@ -17,6 +17,7 @@ func CmdUnassignRegistry() *jiracli.CommandRegistryEntry {
return CmdAssignUsage(cmd, &opts)
},
func(o *oreo.Client, globals *jiracli.GlobalOptions) error {
opts.Issue = jiracli.FormatIssue(opts.Issue, opts.Project)
return CmdAssign(o, globals, &opts)
},
}
+2
View File
@@ -11,6 +11,7 @@ import (
type ViewOptions struct {
jiracli.CommonOptions `yaml:",inline" json:",inline" figtree:",inline"`
jira.IssueOptions `yaml:",inline" json:",inline" figtree:",inline"`
Project string `yaml:"project,omitempty" json:"project,omitempty"`
Issue string `yaml:"issue,omitempty" json:"issue,omitempty"`
}
@@ -28,6 +29,7 @@ func CmdViewRegistry() *jiracli.CommandRegistryEntry {
return CmdViewUsage(cmd, &opts)
},
func(o *oreo.Client, globals *jiracli.GlobalOptions) error {
opts.Issue = jiracli.FormatIssue(opts.Issue, opts.Project)
return CmdView(o, globals, &opts)
},
}
+2
View File
@@ -20,6 +20,7 @@ const (
type VoteOptions struct {
jiracli.CommonOptions `yaml:",inline" json:",inline" figtree:",inline"`
Project string `yaml:"project,omitempty" json:"project,omitempty"`
Issue string `yaml:"issue,omitempty" json:"issue,omitempty"`
Action VoteAction `yaml:"-" json:"-"`
}
@@ -37,6 +38,7 @@ func CmdVoteRegistry() *jiracli.CommandRegistryEntry {
return CmdVoteUsage(cmd, &opts)
},
func(o *oreo.Client, globals *jiracli.GlobalOptions) error {
opts.Issue = jiracli.FormatIssue(opts.Issue, opts.Project)
return CmdVote(o, globals, &opts)
},
}
+28 -2
View File
@@ -2,6 +2,7 @@ package jiracmd
import (
"fmt"
"strings"
"github.com/coryb/figtree"
"github.com/coryb/oreo"
@@ -20,6 +21,7 @@ const (
type WatchOptions struct {
jiracli.CommonOptions `yaml:",inline" json:",inline" figtree:",inline"`
Project string `yaml:"project,omitempty" json:"project,omitempty"`
Issue string `yaml:"issue,omitempty" json:"issue,omitempty"`
Watcher string `yaml:"watcher,omitempty" json:"watcher,omitempty"`
Action WatchAction `yaml:"-" json:"-"`
@@ -38,6 +40,7 @@ func CmdWatchRegistry() *jiracli.CommandRegistryEntry {
return CmdWatchUsage(cmd, &opts)
},
func(o *oreo.Client, globals *jiracli.GlobalOptions) error {
opts.Issue = jiracli.FormatIssue(opts.Issue, opts.Project)
return CmdWatch(o, globals, &opts)
},
}
@@ -50,7 +53,7 @@ func CmdWatchUsage(cmd *kingpin.CmdClause, opts *WatchOptions) error {
return nil
}).Bool()
cmd.Arg("ISSUE", "issue to add watcher").Required().StringVar(&opts.Issue)
cmd.Arg("WATCHER", "username of watcher to add to issue").StringVar(&opts.Watcher)
cmd.Arg("WATCHER", "email or display name of watcher to add to issue").StringVar(&opts.Watcher)
return nil
}
@@ -58,8 +61,31 @@ func CmdWatchUsage(cmd *kingpin.CmdClause, opts *WatchOptions) error {
// with the 'remove' flag)
func CmdWatch(o *oreo.Client, globals *jiracli.GlobalOptions, opts *WatchOptions) error {
if opts.Watcher == "" {
opts.Watcher = globals.User.Value
opts.Watcher = globals.Login.Value
}
if globals.JiraDeploymentType.Value == "" {
serverInfo, err := jira.ServerInfo(o, globals.Endpoint.Value)
if err != nil {
return err
}
globals.JiraDeploymentType.Value = strings.ToLower(serverInfo.DeploymentType)
}
if globals.JiraDeploymentType.Value == jiracli.CloudDeploymentType {
users, err := jira.UserSearch(o, globals.Endpoint.Value, &jira.UserSearchOptions{
Query: opts.Watcher,
})
if err != nil {
return err
}
if len(users) > 1 {
return fmt.Errorf("Found %d accounts for users with username %q", len(users), opts.Watcher)
} else if len(users) == 1 {
opts.Watcher = users[0].AccountID
}
}
if opts.Action == WatcherAdd {
if err := jira.IssueAddWatcher(o, globals.Endpoint.Value, opts.Issue, opts.Watcher); err != nil {
return err
+2
View File
@@ -14,6 +14,7 @@ import (
type WorklogAddOptions struct {
jiracli.CommonOptions `yaml:",inline" json:",inline" figtree:",inline"`
jiradata.Worklog `yaml:",inline" json:",inline" figtree:",inline"`
Project string `yaml:"project,omitempty" json:"project,omitempty"`
Issue string `yaml:"issue,omitempty" json:"issue,omitempty"`
}
@@ -30,6 +31,7 @@ func CmdWorklogAddRegistry() *jiracli.CommandRegistryEntry {
return CmdWorklogAddUsage(cmd, &opts)
},
func(o *oreo.Client, globals *jiracli.GlobalOptions) error {
opts.Issue = jiracli.FormatIssue(opts.Issue, opts.Project)
return CmdWorklogAdd(o, globals, &opts)
},
}
+2
View File
@@ -11,6 +11,7 @@ import (
type WorklogListOptions struct {
jiracli.CommonOptions `yaml:",inline" json:",inline" figtree:",inline"`
Project string `yaml:"project,omitempty" json:"project,omitempty"`
Issue string `yaml:"issue,omitempty" json:"issue,omitempty"`
}
@@ -27,6 +28,7 @@ func CmdWorklogListRegistry() *jiracli.CommandRegistryEntry {
return CmdWorklogListUsage(cmd, &opts)
},
func(o *oreo.Client, globals *jiracli.GlobalOptions) error {
opts.Issue = jiracli.FormatIssue(opts.Issue, opts.Project)
return CmdWorklogList(o, globals, &opts)
},
}
+149
View File
@@ -0,0 +1,149 @@
package jiradata
/////////////////////////////////////////////////////////////////////////
// This Code is Generated by SlipScheme Project:
// https://github.com/coryb/slipscheme
//
// Generated with command:
// /bin/slipscheme -pkg jiradata ActorInput.json AddField.json AddGroup.json ApplicationProperty.json ApplicationRole.json Attachment.json AttachmentArchiveImpl.json AttachmentMeta.json AuditRecord.json AuthParams.json AuthSuccess.json AutoCompleteResponse.json AutoCompleteResultWrapper.json Avatar.json AvatarCropping.json BulkOperationErrorResult.json Comment.json CommentsWithPagination.json Component.json ComponentIssueCounts.json Configuration.json CreateMeta.json CreateUpdateRoleRequest.json CurrentUser.json CustomFieldDefinition.json CustomFieldOption.json Dashboard.json Dashboards.json Default.json DefaultShareScope.json DeleteAndReplaceVersion.json EditMeta.json EntityPropertiesKeys.json EntityProperty.json ErrorCollection.json Field.json Filter.json FilterPermission.json Group.json GroupSuggestions.json HumanReadableArchive.json Id.json IndexSummary.json Issue.json IssueCreateResponse.json IssueLink.json IssueLinkType.json IssueLinkTypes.json IssuePickerResult.json IssueSubTaskMovePosition.json IssueType.json IssueTypeCreate.json IssueTypeMapping.json IssueTypeUpdate.json IssueUpdate.json IssuesUpdate.json LinkIssueRequest.json ListofApplicationRole.json ListofAttachment.json ListofColumnItem.json ListofColumnLayoutItem.json ListofComponent.json ListofField.json ListofFilter.json ListofFilterPermission.json ListofIssueType.json ListofIssueTypeWithStatus.json ListofPriority.json ListofProject.json ListofProjectCategory.json ListofProjectType.json ListofProperty.json ListofRemoteEntityLink.json ListofRemoteIssueLink.json ListofResolution.json ListofScreenableTab.json ListofStatus.json ListofStatusCategory.json ListofUser.json ListofVersion.json ListofWorkflow.json ListofWorkflowMapping.json ListofWorklog.json MoveField.json Notification.json NotificationScheme.json PageofCustomField.json PageofNotificationScheme.json PageofVersion.json Password.json PasswordPolicyCreateUser.json PasswordPolicyUpdateUser.json PermissionGrant.json PermissionGrants.json PermissionScheme.json PermissionSchemeAttribute.json PermissionSchemes.json Permissions.json Priority.json PriorityScheme.json PrioritySchemeList.json PrioritySchemeUpdate.json Project.json ProjectCategory.json ProjectIdentity.json ProjectInput.json ProjectRole.json ProjectRoleActorsUpdate.json ProjectType.json Property.json Reindex.json ReindexRequest.json RemoteEntityLink.json RemoteIssueLink.json RemoteIssueLinkCreateOrUpdateRequest.json RemoteIssueLinkCreateOrUpdateResponse.json Resolution.json Response.json ScreenableField.json ScreenableTab.json SearchRequest.json SearchResults.json SecurityLevel.json SecurityListLevel.json SecurityScheme.json SecuritySchemes.json ServerInfo.json SharePermissionInput.json Status.json StatusCategory.json String.json SystemAvatars.json TransitionsMeta.json UpdateUserToGroup.json UpgradeResult.json User.json UserPickerResults.json UserWrite.json UsersAndGroups.json Version.json VersionIssueCounts.json VersionMove.json VersionUnresolvedIssueCounts.json Vote.json Watchers.json Workflow.json WorkflowMapping.json WorkflowScheme.json Worklog.json WorklogChangedSince.json WorklogIdsRequest.json WorklogWithPagination.json
/////////////////////////////////////////////////////////////////////////
// DO NOT EDIT //
/////////////////////////////////////////////////////////////////////////
// Comments defined from schema:
// {
// "title": "comments",
// "type": "array",
// "items": {
// "title": "Comment",
// "type": "object",
// "properties": {
// "author": {
// "title": "User",
// "type": "object",
// "properties": {
// "active": {
// "type": "boolean"
// },
// "avatarUrls": {
// "type": "object",
// "patternProperties": {
// ".+": {
// "type": "string"
// }
// }
// },
// "displayName": {
// "type": "string"
// },
// "emailAddress": {
// "type": "string"
// },
// "key": {
// "type": "string"
// },
// "name": {
// "type": "string"
// },
// "self": {
// "type": "string"
// },
// "timeZone": {
// "type": "string"
// }
// }
// },
// "body": {
// "title": "body",
// "type": "string"
// },
// "created": {
// "title": "created",
// "type": "string"
// },
// "id": {
// "title": "id",
// "type": "string"
// },
// "properties": {
// "title": "properties",
// "type": "array",
// "items": {
// "title": "Entity Property",
// "type": "object",
// "properties": {
// "key": {
// "title": "key",
// "type": "string"
// },
// "value": {
// "title": "value"
// }
// }
// }
// },
// "renderedBody": {
// "title": "renderedBody",
// "type": "string"
// },
// "self": {
// "title": "self",
// "type": "string"
// },
// "updateAuthor": {
// "title": "User",
// "type": "object",
// "properties": {
// "active": {
// "type": "boolean"
// },
// "avatarUrls": {
// "type": "object",
// "patternProperties": {
// ".+": {
// "type": "string"
// }
// }
// },
// "displayName": {
// "type": "string"
// },
// "emailAddress": {
// "type": "string"
// },
// "key": {
// "type": "string"
// },
// "name": {
// "type": "string"
// },
// "self": {
// "type": "string"
// },
// "timeZone": {
// "type": "string"
// }
// }
// },
// "updated": {
// "title": "updated",
// "type": "string"
// },
// "visibility": {
// "title": "Visibility",
// "type": "object",
// "properties": {
// "type": {
// "title": "type",
// "type": "string"
// },
// "value": {
// "title": "value",
// "type": "string"
// }
// }
// }
// }
// }
// }
type Comments []*Comment
+210
View File
@@ -0,0 +1,210 @@
package jiradata
/////////////////////////////////////////////////////////////////////////
// This Code is Generated by SlipScheme Project:
// https://github.com/coryb/slipscheme
//
// Generated with command:
// /bin/slipscheme -pkg jiradata ActorInput.json AddField.json AddGroup.json ApplicationProperty.json ApplicationRole.json Attachment.json AttachmentArchiveImpl.json AttachmentMeta.json AuditRecord.json AuthParams.json AuthSuccess.json AutoCompleteResponse.json AutoCompleteResultWrapper.json Avatar.json AvatarCropping.json BulkOperationErrorResult.json Comment.json CommentsWithPagination.json Component.json ComponentIssueCounts.json Configuration.json CreateMeta.json CreateUpdateRoleRequest.json CurrentUser.json CustomFieldDefinition.json CustomFieldOption.json Dashboard.json Dashboards.json Default.json DefaultShareScope.json DeleteAndReplaceVersion.json EditMeta.json EntityPropertiesKeys.json EntityProperty.json ErrorCollection.json Field.json Filter.json FilterPermission.json Group.json GroupSuggestions.json HumanReadableArchive.json Id.json IndexSummary.json Issue.json IssueCreateResponse.json IssueLink.json IssueLinkType.json IssueLinkTypes.json IssuePickerResult.json IssueSubTaskMovePosition.json IssueType.json IssueTypeCreate.json IssueTypeMapping.json IssueTypeUpdate.json IssueUpdate.json IssuesUpdate.json LinkIssueRequest.json ListofApplicationRole.json ListofAttachment.json ListofColumnItem.json ListofColumnLayoutItem.json ListofComponent.json ListofField.json ListofFilter.json ListofFilterPermission.json ListofIssueType.json ListofIssueTypeWithStatus.json ListofPriority.json ListofProject.json ListofProjectCategory.json ListofProjectType.json ListofProperty.json ListofRemoteEntityLink.json ListofRemoteIssueLink.json ListofResolution.json ListofScreenableTab.json ListofStatus.json ListofStatusCategory.json ListofUser.json ListofVersion.json ListofWorkflow.json ListofWorkflowMapping.json ListofWorklog.json MoveField.json Notification.json NotificationScheme.json PageofCustomField.json PageofNotificationScheme.json PageofVersion.json Password.json PasswordPolicyCreateUser.json PasswordPolicyUpdateUser.json PermissionGrant.json PermissionGrants.json PermissionScheme.json PermissionSchemeAttribute.json PermissionSchemes.json Permissions.json Priority.json PriorityScheme.json PrioritySchemeList.json PrioritySchemeUpdate.json Project.json ProjectCategory.json ProjectIdentity.json ProjectInput.json ProjectRole.json ProjectRoleActorsUpdate.json ProjectType.json Property.json Reindex.json ReindexRequest.json RemoteEntityLink.json RemoteIssueLink.json RemoteIssueLinkCreateOrUpdateRequest.json RemoteIssueLinkCreateOrUpdateResponse.json Resolution.json Response.json ScreenableField.json ScreenableTab.json SearchRequest.json SearchResults.json SecurityLevel.json SecurityListLevel.json SecurityScheme.json SecuritySchemes.json ServerInfo.json SharePermissionInput.json Status.json StatusCategory.json String.json SystemAvatars.json TransitionsMeta.json UpdateUserToGroup.json UpgradeResult.json User.json UserPickerResults.json UserWrite.json UsersAndGroups.json Version.json VersionIssueCounts.json VersionMove.json VersionUnresolvedIssueCounts.json Vote.json Watchers.json Workflow.json WorkflowMapping.json WorkflowScheme.json Worklog.json WorklogChangedSince.json WorklogIdsRequest.json WorklogWithPagination.json
/////////////////////////////////////////////////////////////////////////
// DO NOT EDIT //
/////////////////////////////////////////////////////////////////////////
// CommentsWithPagination defined from schema:
// {
// "title": "Comments With Pagination",
// "id": "https://docs.atlassian.com/jira/REST/schema/comments-with-pagination#",
// "type": "object",
// "definitions": {
// "user": {
// "title": "User",
// "type": "object",
// "properties": {
// "active": {
// "type": "boolean"
// },
// "avatarUrls": {
// "type": "object",
// "patternProperties": {
// ".+": {
// "type": "string"
// }
// }
// },
// "displayName": {
// "type": "string"
// },
// "emailAddress": {
// "type": "string"
// },
// "key": {
// "type": "string"
// },
// "name": {
// "type": "string"
// },
// "self": {
// "type": "string"
// },
// "timeZone": {
// "type": "string"
// }
// }
// }
// },
// "properties": {
// "comments": {
// "title": "comments",
// "type": "array",
// "items": {
// "title": "Comment",
// "type": "object",
// "properties": {
// "author": {
// "title": "User",
// "type": "object",
// "properties": {
// "active": {
// "type": "boolean"
// },
// "avatarUrls": {
// "type": "object",
// "patternProperties": {
// ".+": {
// "type": "string"
// }
// }
// },
// "displayName": {
// "type": "string"
// },
// "emailAddress": {
// "type": "string"
// },
// "key": {
// "type": "string"
// },
// "name": {
// "type": "string"
// },
// "self": {
// "type": "string"
// },
// "timeZone": {
// "type": "string"
// }
// }
// },
// "body": {
// "title": "body",
// "type": "string"
// },
// "created": {
// "title": "created",
// "type": "string"
// },
// "id": {
// "title": "id",
// "type": "string"
// },
// "properties": {
// "title": "properties",
// "type": "array",
// "items": {
// "title": "Entity Property",
// "type": "object",
// "properties": {
// "key": {
// "title": "key",
// "type": "string"
// },
// "value": {
// "title": "value"
// }
// }
// }
// },
// "renderedBody": {
// "title": "renderedBody",
// "type": "string"
// },
// "self": {
// "title": "self",
// "type": "string"
// },
// "updateAuthor": {
// "title": "User",
// "type": "object",
// "properties": {
// "active": {
// "type": "boolean"
// },
// "avatarUrls": {
// "type": "object",
// "patternProperties": {
// ".+": {
// "type": "string"
// }
// }
// },
// "displayName": {
// "type": "string"
// },
// "emailAddress": {
// "type": "string"
// },
// "key": {
// "type": "string"
// },
// "name": {
// "type": "string"
// },
// "self": {
// "type": "string"
// },
// "timeZone": {
// "type": "string"
// }
// }
// },
// "updated": {
// "title": "updated",
// "type": "string"
// },
// "visibility": {
// "title": "Visibility",
// "type": "object",
// "properties": {
// "type": {
// "title": "type",
// "type": "string"
// },
// "value": {
// "title": "value",
// "type": "string"
// }
// }
// }
// }
// }
// },
// "maxResults": {
// "title": "maxResults",
// "type": "integer"
// },
// "startAt": {
// "title": "startAt",
// "type": "integer"
// },
// "total": {
// "title": "total",
// "type": "integer"
// }
// }
// }
type CommentsWithPagination struct {
Comments Comments `json:"comments,omitempty" yaml:"comments,omitempty"`
MaxResults int `json:"maxResults,omitempty" yaml:"maxResults,omitempty"`
StartAt int `json:"startAt,omitempty" yaml:"startAt,omitempty"`
Total int `json:"total,omitempty" yaml:"total,omitempty"`
}
+13
View File
@@ -0,0 +1,13 @@
package jiradata
type ServerInfo struct {
BaseURL string `json:"baseUrl,omitempty" yaml:"baseUrl,omitempty"`
BuildDate string `json:"buildDate,omitempty" yaml:"buildDate,omitempty"`
BuildNumber int `json:"buildNumber,omitempty" yaml:"buildNumber,omitempty"`
DeploymentType string `json:"deploymentType,omitempty" yaml:"deploymentType,omitempty"`
SCMInfo string `json:"scmInfo,omitempty" yaml:"scmInfo,omitempty"`
ServerTime string `json:"serverTime,omitempty" yaml:"serverTime,omitempty"`
ServerTitle string `json:"serverTitle,omitempty" yaml:"serverTitle,omitempty"`
Version string `json:"version,omitempty" yaml:"version,omitempty"`
VersionNumbers []int `json:"versionNumbers,omitempty" yaml:"versionNumbers,omitempty"`
}
+8 -1
View File
@@ -9,10 +9,17 @@ import (
// or nil
func (t Transitions) Find(name string) *Transition {
name = strings.ToLower(name)
matches := Transitions{}
for _, trans := range t {
if strings.Contains(strings.ToLower(trans.Name), name) {
if strings.ToLower(trans.Name) == name {
return trans
}
if strings.Contains(strings.ToLower(trans.Name), name) {
matches = append(matches, trans)
}
}
if len(matches) > 0 {
return matches[0]
}
return nil
}
+20
View File
@@ -25,3 +25,23 @@ func GetProjectComponents(ua HttpClient, endpoint string, project string) (*jira
}
return nil, responseError(resp)
}
// https://developer.atlassian.com/cloud/jira/platform/rest/v2#api-api-2-project-projectIdOrKey-versions-get
func (j *Jira) GetProjectVersions(project string) (*jiradata.Versions, error) {
return GetProjectVersions(j.UA, j.Endpoint, project)
}
func GetProjectVersions(ua HttpClient, endpoint string, project string) (*jiradata.Versions, error) {
uri := URLJoin(endpoint, "rest/api/2/project", project, "versions")
resp, err := ua.GetJSON(uri)
if err != nil {
return nil, err
}
defer resp.Body.Close()
if resp.StatusCode == 200 {
results := jiradata.Versions{}
return &results, json.NewDecoder(resp.Body).Decode(&results)
}
return nil, responseError(resp)
}
+63
View File
@@ -0,0 +1,63 @@
package main
import (
"encoding/json"
"fmt"
"io/ioutil"
"net/http"
"strings"
"golang.org/x/net/html"
)
func mayPanic(err error) {
if err != nil {
panic(err)
}
}
func main() {
resp, err := http.Get("https://docs.atlassian.com/software/jira/docs/api/REST/7.12.0/")
mayPanic(err)
defer resp.Body.Close()
capture := false
nextCodeBlock := false
stream := html.NewTokenizer(resp.Body)
var buffer string
for tt := stream.Next(); tt != html.ErrorToken; tt = stream.Next() {
t := stream.Token()
if t.Data == "h6" && tt == html.StartTagToken {
capture = true
}
if t.Data == "h6" && tt == html.EndTagToken {
capture = false
if strings.Contains(strings.ToLower(buffer), "schema") {
nextCodeBlock = true
}
buffer = ""
}
if nextCodeBlock && t.Data == "code" && tt == html.StartTagToken {
capture = true
}
if nextCodeBlock && t.Data == "code" && tt == html.EndTagToken {
capture = false
schema := map[string]interface{}{}
err := json.Unmarshal([]byte(buffer), &schema)
mayPanic(err)
title, ok := schema["title"].(string)
if ok {
title = strings.ReplaceAll(title, " ", "")
fileName := fmt.Sprintf("%s.json", title)
fmt.Printf("Writing %s\n", fileName)
err := ioutil.WriteFile(fileName, []byte(buffer), 0644)
mayPanic(err)
}
buffer = ""
nextCodeBlock = false
}
if capture && tt == html.TextToken {
buffer += t.Data
}
}
}
-21
View File
@@ -1,21 +0,0 @@
#!/usr/bin/env python
from lxml import html
import requests
import json
page = requests.get('https://docs.atlassian.com/jira/REST/cloud')
tree = html.fromstring(page.content)
schemas = tree.xpath("//div[@class='representation-doc-block']//code/text()")
for schema in schemas:
try:
data = json.loads(schema)
if "title" in data:
title = data["title"].replace(" ", "")
print "Writing {}.json".format(title)
with open("{}.json".format(title), 'w') as f:
f.write(schema)
except:
True
+2 -2
View File
@@ -72,7 +72,7 @@ func (o *SearchOptions) ProvideSearchRequest() *jiradata.SearchRequest {
return req
}
// https://docs.atlassian.com/jira/REST/cloud/#api/2/search-searchUsingSearchRequest
// https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issue-search/#api-rest-api-3-search-jql-post
func (j *Jira) Search(sp SearchProvider, opts ...SearchOpt) (*jiradata.SearchResults, error) {
return Search(j.UA, j.Endpoint, sp, opts...)
}
@@ -108,7 +108,7 @@ func Search(ua HttpClient, endpoint string, sp SearchProvider, opts ...SearchOpt
if err != nil {
return nil, err
}
uri := URLJoin(endpoint, "rest/api/2/search")
uri := URLJoin(endpoint, "rest/api/3/search/jql")
resp, err := ua.Post(uri, "application/json", bytes.NewBuffer(encoded))
if err != nil {
return nil, err
+22
View File
@@ -0,0 +1,22 @@
package jira
import (
"encoding/json"
"github.com/go-jira/jira/jiradata"
)
func ServerInfo(ua HttpClient, endpoint string) (*jiradata.ServerInfo, error) {
uri := URLJoin(endpoint, "rest/api/2/serverInfo")
resp, err := ua.GetJSON(uri)
if err != nil {
return nil, err
}
defer resp.Body.Close()
if resp.StatusCode == 200 {
results := jiradata.ServerInfo{}
return &results, json.NewDecoder(resp.Body).Decode(&results)
}
return nil, responseError(resp)
}
+49
View File
@@ -0,0 +1,49 @@
config:
stop: true
endpoint: https://go-jira.atlassian.net
password-source: stdin
user: gojira
login: gojira@corybennett.org
project: BASIC
queries:
todo: >-
resolution = unresolved {{if .project}}AND project = '{{.project}}'{{end}} AND status = 'To Do'
custom-commands:
- name: env
help: print the JIRA environment variables available to custom commands
script: |-
env | sort | grep JIRA
- name: print-project
help: print the name of the configured project
script: "echo $JIRA_PROJECT"
- name: jira-path
help: print the path the jira command that is running this alias
script: |-
echo {{jira}}
- name: mine
help: display issues assigned to me
script: |-
if [ -n "$JIRA_PROJECT" ]; then
# if `project: ...` configured just list the issues for current project
{{jira}} list --template table --query "resolution = unresolved and assignee=currentuser() and project = $JIRA_PROJECT ORDER BY priority asc, created"
else
# otherwise list issues for all project
{{jira}} list --template table --query "resolution = unresolved and assignee=currentuser() ORDER BY priority asc, created"
fi
- name: argtest
help: testing passing args
script: |-
echo {{args.ARG}}
args:
- name: ARG
help: string to echo for testing
- name: opttest
help: testing passing option flags
script: |-
echo {{options.OPT}}
options:
- name: OPT
help: string to echo for testing
+1
View File
@@ -0,0 +1 @@
template: list
+56
View File
@@ -0,0 +1,56 @@
package test
import (
"bytes"
"fmt"
"io"
"os"
"os/exec"
)
// withApiLogin is a hack to provide an api token on every command, this means keyring
// and gpg is not necessary to run the testing suite.
//
// a buffer containing stdout will be returned to the caller if no error is encountered.
// this still expects a config file is in a parent where the test runs for project
// and endpoint details.
func withApiLogin(login string, token string, cmd *exec.Cmd) (bytes.Buffer, error) {
var buf bytes.Buffer
cmd.Args = append(cmd.Args, "--login", login)
diag := fmt.Sprintf("--- running command: %+v ---\n", cmd.Args)
io.WriteString(os.Stdout, diag)
// write to stdout and also to our buffer
out := io.MultiWriter(&buf, os.Stdout)
cmd.Stdout = out
e := io.MultiWriter(&buf, os.Stderr)
cmd.Stderr = e
in, err := cmd.StdinPipe()
if err != nil {
return buf, err
}
err = cmd.Start()
if err != nil {
return buf, err
}
_, err = io.WriteString(in, token)
if err != nil {
return buf, err
}
in.Close()
err = cmd.Wait()
if err != nil {
return buf, err
}
diag = fmt.Sprintf("--- finished command: %+v ---\n\n", cmd.Args)
io.WriteString(os.Stdout, diag)
return buf, nil
}
+98
View File
@@ -0,0 +1,98 @@
package test
import (
"bytes"
"fmt"
"strings"
"testing"
"github.com/google/go-cmp/cmp"
)
func checkDiff(t *testing.T, buf bytes.Buffer, expect string, formats ...interface{}) {
expect = fmt.Sprintf(expect, formats...)
if !cmp.Equal(expect, buf.String()) {
t.Fatal(
cmp.Diff(
buf.String(),
expect,
),
)
}
}
func checkCreateIssue(t *testing.T, buf bytes.Buffer, endpoint string) string {
out := strings.Split(buf.String(), " ")
if len(out) < 3 {
t.Fatalf("unexpected split count on create output: %v", buf.String())
}
issue := out[1]
expect := fmt.Sprintf("OK %s %s/browse/%s\n", issue, endpoint, issue)
if !cmp.Equal(expect, buf.String()) {
t.Fatal(
cmp.Diff(
buf.String(),
expect,
),
)
}
return issue
}
func checkEditIssue(t *testing.T, buf bytes.Buffer, issue, endpoint string) {
out := strings.Split(buf.String(), " ")
if len(out) < 3 {
t.Fatalf("unexpected split count on create output: %v", buf.String())
}
editedIssue := out[1]
expect := fmt.Sprintf("OK %s %s/browse/%s\n", issue, endpoint, issue)
if !cmp.Equal(expect, buf.String()) {
t.Fatal(
cmp.Diff(
buf.String(),
expect,
),
)
}
if !cmp.Equal(editedIssue, issue) {
t.Fatal(
cmp.Diff(
editedIssue,
issue,
),
)
}
}
func checkIssueInOutput(t *testing.T, buf bytes.Buffer, issue string) {
if !strings.Contains(buf.String(), issue) {
t.Fatalf("issue %s not located in stdout: %s", issue, buf.String())
}
}
func checkIssueNotInOutput(t *testing.T, buf bytes.Buffer, issue string) {
if strings.Contains(buf.String(), issue) {
t.Fatalf("issue %s not located in stdout: %s", issue, buf.String())
}
}
func checkBlockIssue(t *testing.T, buf bytes.Buffer, issue, blocker, endpoint string) {
checkDualIssues(t, buf, blocker, issue, endpoint)
}
func checkDupIssue(t *testing.T, buf bytes.Buffer, issue, duplicate, endpoint string) {
checkDualIssues(t, buf, issue, duplicate, endpoint)
}
func checkDualIssues(t *testing.T, buf bytes.Buffer, first, second, endpoint string) {
lines := strings.Split(buf.String(), "\n")
if len(lines) < 2 {
t.Fatalf("unexpected split count on create output: %v", buf.String())
}
testBuf := bytes.NewBuffer([]byte(lines[0] + "\n"))
checkEditIssue(t, *testBuf, first, endpoint)
testBuf = bytes.NewBuffer([]byte(lines[1] + "\n"))
checkEditIssue(t, *testBuf, second, endpoint)
}
+815
View File
@@ -0,0 +1,815 @@
package test
import (
"bytes"
"os"
"path/filepath"
"strings"
"testing"
)
const (
endpoint = "https://go-jira.atlassian.net"
goJiraApiToken = "Rw1cPlKI40TJeEl1Pj88A5ED"
goJiraLogin = "gojira@corybennett.org"
mothraApiToken = "UNXrI9gq5p0LWUtblAxDA7A6"
mothraLogin = "mothra@corybennett.org"
)
var jira string = "../dist/github.com/go-jira/jira-linux-amd64"
func Test_CLI(t *testing.T) {
// setup the jira cli environment
jira, err := filepath.Abs(jira)
if err != nil {
t.Fatal(err)
}
if !filepath.IsAbs(jira) {
t.Fatalf("could not obtain absolute path to jira binary")
}
if _, err := os.Stat(jira); err != nil {
t.Fatalf("could not stat %v: %v", jira, err)
}
os.Setenv("COLUMNS", "149")
os.Setenv("JIRA_LOG_FORMAT", "%{level:-5s} %{message}")
os.Setenv("ENDPOINT", endpoint)
os.Setenv("JIRACLOUD", "1")
t.Run("basic", test_Basic)
t.Run("pagination", test_Pagination)
}
// test_Basic will test the basic functionality required in the cli
func test_Basic(t *testing.T) {
// we'll reassign these often, just create
// them here.
var buf bytes.Buffer
var err error
// Create an issue
buf, err = withApiLogin(
goJiraLogin,
goJiraApiToken,
createIssue(
jira,
"BASIC",
"summary",
"description",
),
)
if err != nil {
t.Fatalf("cmd failed. stdout: %v err: %v", buf.String(), err)
}
issue := checkCreateIssue(t, buf, endpoint)
// View the issue
buf, err = withApiLogin(
goJiraLogin,
goJiraApiToken,
viewIssue(
jira,
issue,
),
)
checkDiff(t, buf, `issue: %s
created: a minute ago
status: To Do
summary: summary
project: BASIC
issuetype: Bug
assignee: GoJira
reporter: GoJira
priority: Medium
votes: 0
description: |
description
`, issue)
// confirm new issue shows in project list
buf, err = withApiLogin(
goJiraLogin,
goJiraApiToken,
listIssues(
jira,
"BASIC",
"", // empty string means do not use a named query
"", // empty string means do not use raw query
"", // empty string means do not use a template
"", // empty string means do not limit response
),
)
checkIssueInOutput(t, buf, issue)
// confirm issue appears with named query
buf, err = withApiLogin(
goJiraLogin,
goJiraApiToken,
listIssues(
jira,
"BASIC",
"todo",
"",
"",
"",
),
)
checkIssueInOutput(t, buf, issue)
// confirm issue appears with table template
buf, err = withApiLogin(
goJiraLogin,
goJiraApiToken,
listIssues(
jira,
"BASIC",
"",
"",
"table",
"",
),
)
checkIssueInOutput(t, buf, issue)
// edit an issue
buf, err = withApiLogin(
goJiraLogin,
goJiraApiToken,
editIssue(
jira,
issue,
"edit comment",
"priority=High",
"",
),
)
checkEditIssue(t, buf, issue, endpoint)
// edit multiple issues with query and check comments updated
buf, err = withApiLogin(
goJiraLogin,
goJiraApiToken,
editIssue(
jira,
issue,
"bulk edit comment",
"priority=High",
`resolution = unresolved AND project = 'BASIC' AND status = 'To Do'`,
),
)
checkEditIssue(t, buf, issue, endpoint)
// view the issue
buf, err = withApiLogin(
goJiraLogin,
goJiraApiToken,
viewIssue(
jira,
issue,
),
)
checkDiff(t, buf, `issue: %s
created: a minute ago
status: To Do
summary: summary
project: BASIC
issuetype: Bug
assignee: GoJira
reporter: GoJira
priority: High
votes: 0
description: |
description
comments:
- | # GoJira, a minute ago
edit comment
- | # GoJira, a minute ago
bulk edit comment
`, issue)
// try invalid close of issue
buf, err = withApiLogin(
goJiraLogin,
goJiraApiToken,
closeIssue(
jira,
issue,
),
)
checkDiff(t, buf, `ERROR Invalid Transition "close" from "To Do", Available: To Do, In Progress, In Review, Done
`)
// put issue in done state
buf, err = withApiLogin(
goJiraLogin,
goJiraApiToken,
doneIssue(
jira,
issue,
),
)
checkEditIssue(t, buf, issue, endpoint)
// make sure our resolved issue is not present in the project
buf, err = withApiLogin(
goJiraLogin,
goJiraApiToken,
listIssues(
jira,
"BASIC",
"",
"",
"",
"",
),
)
checkIssueNotInOutput(t, buf, issue)
// create two new issues to test duplicating
buf, err = withApiLogin(
goJiraLogin,
goJiraApiToken,
createIssue(
jira,
"BASIC",
"summary",
"description",
),
)
issue = checkCreateIssue(t, buf, endpoint)
buf, err = withApiLogin(
goJiraLogin,
goJiraApiToken,
createIssue(
jira,
"BASIC",
"dup",
"dup",
),
)
dup := checkCreateIssue(t, buf, endpoint)
// mark issue as duplicate
buf, err = withApiLogin(
goJiraLogin,
goJiraApiToken,
dupIssue(
jira,
issue,
dup,
),
)
checkDupIssue(t, buf, issue, dup, endpoint)
buf, err = withApiLogin(
goJiraLogin,
goJiraApiToken,
viewIssue(
jira,
issue,
),
)
checkDiff(t, buf, `issue: %s
created: a minute ago
status: To Do
summary: summary
project: BASIC
issuetype: Bug
assignee: GoJira
reporter: GoJira
blockers:
depends: %s[Done]
priority: Medium
votes: 0
description: |
description
`, issue, dup)
// check dup is resolved and not in listed issue
buf, err = withApiLogin(
goJiraLogin,
goJiraApiToken,
listIssues(jira,
"BASIC",
"",
"",
"",
""),
)
checkIssueNotInOutput(t, buf, dup)
// create blocker issue
buf, err = withApiLogin(
goJiraLogin,
goJiraApiToken,
createIssue(
jira,
"BASIC",
"blocks",
"blocks",
),
)
blocker := checkCreateIssue(t, buf, endpoint)
// set blocker
buf, err = withApiLogin(
goJiraLogin,
goJiraApiToken,
blockIssue(
jira,
blocker,
issue,
),
)
checkBlockIssue(t, buf, blocker, issue, endpoint)
// confirm blocker shows up when viewing issue
buf, err = withApiLogin(
goJiraLogin,
goJiraApiToken,
viewIssue(
jira,
issue,
),
)
checkDiff(t, buf, `issue: %s
created: a minute ago
status: To Do
summary: summary
project: BASIC
issuetype: Bug
assignee: GoJira
reporter: GoJira
blockers: %s[To Do]
depends: %s[Done]
priority: Medium
votes: 0
description: |
description
`, issue, blocker, dup)
// confirm both issues are unresolved
buf, err = withApiLogin(
goJiraLogin,
goJiraApiToken,
listIssues(
jira,
"BASIC",
"",
"",
"",
"",
),
)
checkIssueInOutput(t, buf, issue)
checkIssueInOutput(t, buf, blocker)
// //
// begin using mothra user //
// //
// use mothra to vote for main issue
buf, err = withApiLogin(
mothraLogin,
mothraApiToken,
voteIssue(
jira,
issue,
false,
),
)
checkEditIssue(t, buf, issue, endpoint)
// view issue to confirm vote
buf, err = withApiLogin(
mothraLogin,
mothraApiToken,
viewIssue(
jira,
issue,
),
)
checkDiff(t, buf, `issue: %s
created: a minute ago
status: To Do
summary: summary
project: BASIC
issuetype: Bug
assignee: GoJira
reporter: GoJira
blockers: %s[To Do]
depends: %s[Done]
priority: Medium
votes: 1
description: |
description
`, issue, blocker, dup)
// down vote and confirm
buf, err = withApiLogin(
mothraLogin,
mothraApiToken,
voteIssue(
jira,
issue,
true, // down vote true
),
)
checkEditIssue(t, buf, issue, endpoint)
// view issue to confirm vote
buf, err = withApiLogin(
mothraLogin,
mothraApiToken,
viewIssue(
jira,
issue,
),
)
checkDiff(t, buf, `issue: %s
created: a minute ago
status: To Do
summary: summary
project: BASIC
issuetype: Bug
assignee: GoJira
reporter: GoJira
blockers: %s[To Do]
depends: %s[Done]
priority: Medium
votes: 0
description: |
description
`, issue, blocker, dup)
// TODO(louis): skipping watcher test for now until a
// "watchers" command is implemented.
// set blocker to "In Progress"
buf, err = withApiLogin(
mothraLogin,
mothraApiToken,
transIssue(
jira,
"In Progress",
blocker,
),
)
checkEditIssue(t, buf, blocker, endpoint)
// set it back to "To Do"
buf, err = withApiLogin(
mothraLogin,
mothraApiToken,
todoIssue(
jira,
blocker,
),
)
checkEditIssue(t, buf, blocker, endpoint)
// set it to "In Review"
buf, err = withApiLogin(
mothraLogin,
mothraApiToken,
transIssue(
jira,
"review",
blocker,
),
)
checkEditIssue(t, buf, blocker, endpoint)
// set it back to "To Do"
buf, err = withApiLogin(
mothraLogin,
mothraApiToken,
todoIssue(
jira,
blocker,
),
)
checkEditIssue(t, buf, blocker, endpoint)
// set it to in progress
buf, err = withApiLogin(
mothraLogin,
mothraApiToken,
progIssue(
jira,
blocker,
),
)
checkEditIssue(t, buf, blocker, endpoint)
// set it to in done
buf, err = withApiLogin(
mothraLogin,
mothraApiToken,
doneIssue(
jira,
blocker,
),
)
checkEditIssue(t, buf, blocker, endpoint)
// confirm blocker is done
buf, err = withApiLogin(
mothraLogin,
mothraApiToken,
viewIssue(
jira,
issue,
),
)
checkDiff(t, buf, `issue: %s
created: a minute ago
status: To Do
summary: summary
project: BASIC
issuetype: Bug
assignee: GoJira
reporter: GoJira
blockers: %s[Done]
depends: %s[Done]
priority: Medium
votes: 0
description: |
description
`, issue, blocker, dup)
// verify we can add comment
buf, err = withApiLogin(
mothraLogin,
mothraApiToken,
commentIssue(
jira,
issue,
"Yo, Comment",
),
)
checkEditIssue(t, buf, issue, endpoint)
// verify we can see comment
buf, err = withApiLogin(
mothraLogin,
mothraApiToken,
viewIssue(
jira,
issue,
),
)
checkDiff(t, buf, `issue: %s
created: a minute ago
status: To Do
summary: summary
project: BASIC
issuetype: Bug
assignee: GoJira
reporter: GoJira
blockers: %s[Done]
depends: %s[Done]
priority: Medium
votes: 0
description: |
description
comments:
- | # Mothra, a minute ago
Yo, Comment
`, issue, blocker, dup)
// verify we can add labels
buf, err = withApiLogin(
mothraLogin,
mothraApiToken,
addLabelsIssue(
jira,
blocker,
"test-label",
"another-label",
),
)
checkEditIssue(t, buf, blocker, endpoint)
buf, err = withApiLogin(
mothraLogin,
mothraApiToken,
viewIssue(
jira,
blocker,
),
)
checkDiff(t, buf, `issue: %s
created: a minute ago
status: Done
summary: blocks
project: BASIC
issuetype: Bug
assignee: GoJira
reporter: GoJira
blockers:
depends: %s[To Do]
priority: Medium
votes: 0
labels: another-label, test-label
description: |
blocks
`, blocker, issue)
// verify we can remove labels
buf, err = withApiLogin(
mothraLogin,
mothraApiToken,
removeLabelsIssue(
jira,
blocker,
"another-label",
),
)
checkEditIssue(t, buf, blocker, endpoint)
buf, err = withApiLogin(
mothraLogin,
mothraApiToken,
viewIssue(
jira,
blocker,
),
)
checkDiff(t, buf, `issue: %s
created: a minute ago
status: Done
summary: blocks
project: BASIC
issuetype: Bug
assignee: GoJira
reporter: GoJira
blockers:
depends: %s[To Do]
priority: Medium
votes: 0
labels: test-label
description: |
blocks
`, blocker, issue)
// verify we can replace labels
buf, err = withApiLogin(
mothraLogin,
mothraApiToken,
setLabelsIssue(
jira,
blocker,
"more-label",
"better-label",
),
)
checkEditIssue(t, buf, blocker, endpoint)
buf, err = withApiLogin(
mothraLogin,
mothraApiToken,
viewIssue(
jira,
blocker,
),
)
checkDiff(t, buf, `issue: %s
created: a minute ago
status: Done
summary: blocks
project: BASIC
issuetype: Bug
assignee: GoJira
reporter: GoJira
blockers:
depends: %s[To Do]
priority: Medium
votes: 0
labels: better-label, more-label
description: |
blocks
`, blocker, issue)
// verify mothra can take an issue
buf, err = withApiLogin(
mothraLogin,
mothraApiToken,
takeIssue(
jira,
blocker,
),
)
checkEditIssue(t, buf, blocker, endpoint)
buf, err = withApiLogin(
mothraLogin,
mothraApiToken,
viewIssue(
jira,
blocker,
),
)
checkDiff(t, buf, `issue: %s
created: a minute ago
status: Done
summary: blocks
project: BASIC
issuetype: Bug
assignee: Mothra
reporter: GoJira
blockers:
depends: %s[To Do]
priority: Medium
votes: 0
labels: better-label, more-label
description: |
blocks
`, blocker, issue)
// verify martha can give the issue back
buf, err = withApiLogin(
mothraLogin,
mothraApiToken,
giveIssue(
jira,
blocker,
"gojira",
),
)
checkEditIssue(t, buf, blocker, endpoint)
buf, err = withApiLogin(
mothraLogin,
mothraApiToken,
viewIssue(
jira,
blocker,
),
)
checkDiff(t, buf, `issue: %s
created: a minute ago
status: Done
summary: blocks
project: BASIC
issuetype: Bug
assignee: GoJira
reporter: GoJira
blockers:
depends: %s[To Do]
priority: Medium
votes: 0
labels: better-label, more-label
description: |
blocks
`, blocker, issue)
}
func test_Pagination(t *testing.T) {
var buf bytes.Buffer
var err error
// note:
// we test limit+1 to handle extra newline split
buf, err = withApiLogin(
goJiraLogin,
goJiraApiToken,
listIssues(
jira,
"BASIC",
"",
"project = 'BASIC' AND status = 'Done'", // query
"",
"102",
),
)
if err != nil {
t.Fatalf("failed to list issues. stderr:%v err: %v", buf.String(), err)
}
if len(strings.Split(buf.String(), "\n")) != 103 {
t.Fatalf("got: %v want: %v", len(strings.Split(buf.String(), "\n")), 103)
}
buf, err = withApiLogin(
goJiraLogin,
goJiraApiToken,
listIssues(
jira,
"BASIC",
"",
"project = 'BASIC' AND status = 'Done'", // query
"", // empty string means do not use a template
"1",
),
)
if err != nil {
t.Fatalf("failed to list issues. stderr:%v err: %v", buf.String(), err)
}
if len(strings.Split(buf.String(), "\n")) != 2 {
t.Fatalf("got: %v want: %v", len(strings.Split(buf.String(), "\n")), 2)
}
}
+226
View File
@@ -0,0 +1,226 @@
package test
import (
"os/exec"
)
func session(jira string) *exec.Cmd {
cmd := exec.Command(
jira,
"session",
)
return cmd
}
func createIssue(jira, project, summary, description string) *exec.Cmd {
sum := "summary=" + summary
desc := "description=" + description
cmd := exec.Command(
jira,
"create",
"--project", project,
"-o", sum,
"-o", desc,
"--noedit",
)
return cmd
}
func viewIssue(jira, issue string) *exec.Cmd {
return exec.Command(
jira,
"view",
issue,
)
}
func listIssues(jira, project, query, rawquery, template, limit string) *exec.Cmd {
cmd := exec.Command(
jira,
"ls",
"--project",
project,
)
if query != "" {
cmd.Args = append(cmd.Args, "-n", query)
}
if rawquery != "" {
cmd.Args = append(cmd.Args, "-q", rawquery)
}
if template != "" {
cmd.Args = append(cmd.Args, "--template", template)
}
if limit != "" {
cmd.Args = append(cmd.Args, "--limit", limit)
}
return cmd
}
func editIssue(jira, issue, message, override, query string) *exec.Cmd {
cmd := exec.Command(
jira,
"edit",
issue,
"-m",
message,
"--override",
override,
"--noedit",
)
if query != "" {
cmd.Args = append(cmd.Args, "--query", query)
}
return cmd
}
func closeIssue(jira, issue string) *exec.Cmd {
cmd := exec.Command(
jira,
"close",
issue,
)
return cmd
}
func doneIssue(jira, issue string) *exec.Cmd {
cmd := exec.Command(
jira,
"done",
issue,
)
return cmd
}
func dupIssue(jira, issue, duplicate string) *exec.Cmd {
cmd := exec.Command(
jira,
"dup",
duplicate,
issue,
)
return cmd
}
func blockIssue(jira, blocker, issue string) *exec.Cmd {
cmd := exec.Command(
jira,
"block",
blocker,
issue,
)
return cmd
}
func voteIssue(jira, issue string, down bool) *exec.Cmd {
cmd := exec.Command(
jira,
"vote",
issue,
)
if down {
cmd.Args = append(cmd.Args, "--down")
}
return cmd
}
func watchIssue(jira, issue string) *exec.Cmd {
cmd := exec.Command(
jira,
"watch",
issue,
)
return cmd
}
func transIssue(jira, trans, issue string) *exec.Cmd {
cmd := exec.Command(
jira,
"trans",
trans,
issue,
"--noedit",
)
return cmd
}
func todoIssue(jira, issue string) *exec.Cmd {
cmd := exec.Command(
jira,
"todo",
issue,
)
return cmd
}
func progIssue(jira, issue string) *exec.Cmd {
cmd := exec.Command(
jira,
"prog",
issue,
)
return cmd
}
func commentIssue(jira, issue, comment string) *exec.Cmd {
cmd := exec.Command(
jira,
"comment",
issue,
"--noedit",
"-m",
comment,
)
return cmd
}
func addLabelsIssue(jira, issue string, labels ...string) *exec.Cmd {
cmd := exec.Command(
jira,
"labels",
"add",
issue,
)
cmd.Args = append(cmd.Args, labels...)
return cmd
}
func removeLabelsIssue(jira, issue string, labels ...string) *exec.Cmd {
cmd := exec.Command(
jira,
"labels",
"remove",
issue,
)
cmd.Args = append(cmd.Args, labels...)
return cmd
}
func setLabelsIssue(jira, issue string, labels ...string) *exec.Cmd {
cmd := exec.Command(
jira,
"labels",
"set",
issue,
)
cmd.Args = append(cmd.Args, labels...)
return cmd
}
func takeIssue(jira, issue string) *exec.Cmd {
cmd := exec.Command(
jira,
"take",
issue,
)
return cmd
}
func giveIssue(jira, issue, taker string) *exec.Cmd {
cmd := exec.Command(
jira,
"give",
issue,
taker,
)
return cmd
}
+55
View File
@@ -0,0 +1,55 @@
package jira
import (
"encoding/json"
"fmt"
"net/url"
"strings"
"github.com/go-jira/jira/jiradata"
)
type UserSearchOptions struct {
Query string `yaml:"query,omitempty" json:"query,omitempty"`
Username string `yaml:"username,omitempty" json:"username,omitempty"`
AccountID string `yaml:"accountId,omitempty" json:"accountId,omitempty"`
StartAt int `yaml:"startAt,omitempty" json:"startAt,omitempty"`
MaxResults int `yaml:"max-results,omitempty" json:"max-results,omitempty"`
Property string `yaml:"property,omitempty" json:"property,omitempty"`
}
// https://developer.atlassian.com/cloud/jira/platform/rest/v2/#api-rest-api-2-user-search-get
func UserSearch(ua HttpClient, endpoint string, opts *UserSearchOptions) ([]*jiradata.User, error) {
uri := URLJoin(endpoint, "rest/api/2/user/search")
params := []string{}
if opts.Query != "" {
params = append(params, "query="+url.QueryEscape(opts.Query))
}
if opts.AccountID != "" {
params = append(params, "accountId="+url.QueryEscape(opts.AccountID))
}
if opts.StartAt != 0 {
params = append(params, fmt.Sprintf("startAt=%d", opts.StartAt))
}
if opts.MaxResults != 0 {
params = append(params, fmt.Sprintf("maxResults=%d", opts.MaxResults))
}
if opts.Property != "" {
params = append(params, "property="+url.QueryEscape(opts.Property))
}
if len(params) > 0 {
uri += "?" + strings.Join(params, "&")
}
resp, err := ua.GetJSON(uri)
if err != nil {
return nil, err
}
defer resp.Body.Close()
if resp.StatusCode == 200 {
results := []*jiradata.User{}
return results, json.NewDecoder(resp.Body).Decode(&results)
}
return nil, responseError(resp)
}