go-jira / jira

simple jira command line client in Go
Apache License 2.0
2.68k stars 328 forks source link

jira ls `POST` to search endpoint? #68

Closed neurosnap closed 7 years ago

neurosnap commented 7 years ago

I'm trying to us this cli but am running into some issues.

It looks like doing an ls is trying to POST to an endpoint that to me seems like it should be a GET jira ls -v

2017-02-07T22:40:09.585-05:00 INFO  [cli.go:179] POST https://notionai.atlassian.net/rest/api/2/search
2017-02-07T22:40:10.053-05:00 ERROR [cli.go:244] response status: 400 Bad Request
2017-02-07T22:40:10.053-05:00 ERROR [util.go:234] Field 'resolution' does not exist or this field cannot be viewed by anonymous users.
2017-02-07T22:40:10.053-05:00 ERROR [util.go:234] The value 'NOTION' does not exist for the field 'project'.
2017-02-07T22:40:10.053-05:00 ERROR [util.go:234] Not able to sort using field 'priority'.
coryb commented 7 years ago

It should be a POST, we need to send the JQL query to the /search endpoint. Your issue seems to be you are not logged in which is why you are getting cannot be viewed by anonymous users.

Check out the docs here: https://github.com/Netflix-Skunkworks/go-jira#authentication -Cory

neurosnap commented 7 years ago

Hmm, I do jira login which has my username via user: ebower then I type in my password. I get no indication that the auth has failed or succeeded.

> jira login
Jira Password [ebower]: ********
> 

jira ls then throws the above error.

coryb commented 7 years ago

Basically I think the jira login worked but the cache cookie will not work with the subsequent jira ls

Did you set:

password-source: keyring

or

password-source: pass

The default go-jira password source is cookie based authentication, which Atlassian has disabled for *.atlassian.net hosted Jira. So you will need to set one of those. I have also make a new release: https://github.com/Netflix-Skunkworks/go-jira/releases/tag/v0.1.10 which might fix some issues with passwords.

neurosnap commented 7 years ago

Your latest version worked! If I specify pass does that mean I have to type the password every single time I issue a command?

coryb commented 7 years ago

No, pass means go-jira will try to fetch the password from the pass command line tool, as documented here: https://github.com/Netflix-Skunkworks/go-jira#pass-password-source

neurosnap commented 7 years ago

Great thanks!