I am attempting to piece together how I can use the JIRA CLI with an API token instead of a password.
The example provided in the documentation is this
java -jar `dirname $0`/lib/jira-cli-7.8.0.jar --server https://my.example.com --user automation --password "automation" "$@
I've attempted to modify it to match curl examples provided [here](https://community.atlassian.com/t5/Jira-questions/How-do-I-get-an-authorization-API/qaq-p/818421) and on the API tokens documentation ([here](https://confluence.atlassian.com/cloud/api-tokens-938839638.html))
java -jar `dirname $0`/lib/jira-cli-7.8.0.jar --server https://my.example.com --user me@example.com:myprovidedtoken "$@
However, this doesn't work. When I run
./jira.sh --action getServerInfo --outputFormat 2
I get:
This function requires a non-blank value for parameter password.
Moving the token to the password parameter doesn't work either:
java -jar `dirname $0`/lib/jira-cli-7.8.0.jar --server https://my.example.com --user me@example.com --password "myprovidedtoken" "$@
Then rerunning:
./jira.sh --action getServerInfo --outputFormat 2
Remote error: User is not authorized to perform the request. Response code: 401.
I am an admin and should have fun access.
Question: How do I properly pass an API token to the jira CLI?
Bonus, in case I missed a permission: How do I grant a user access to utilize the API?
Can you please confirm your CLI version? The support for Access Token is available from CLI 7.7 . See the last comment on the ticket :
https://bobswift.atlassian.net/browse/ACLI-191
If your version is correct then you should be able to provide token in the password value.
Below is the documentation for this :
https://bobswift.atlassian.net/wiki/spaces/ACLI/pages/392757809/Authentication
Regards
Prakhar
Hi @Prakhar Srivastav {Appfire}, I had been using CLI7.8, but moved to the snapshot 7.9 this morning. That seems to be working.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Andy Wegner
It should work with CLI 7.8 also. If it is not , can you please raise a bug here .
https://bobswift.atlassian.net
Regards
Prakhar
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.