How do I use atlassian-cli products with complex passwords?

John Chapman September 5, 2012

Eg, supposing my password is 'foo(bar'

How do I provide this password to jira-cli.jar?

- I assumed the password would have to be escaped, so in my script I would provide 'foo\(bar' instead, however the password then does not match.

2 answers

1 accepted

1 vote
Answer accepted
Bob Swift OSS (Bob Swift Atlassian Apps)
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 5, 2012

There has been problems with this in the past, but most of these issues have been resolved at least in the current 2.7.0-SNAPSHOT. Please report any instances where this is not the case. You must not escape them, but you should always double quote the parameter to cover the case where the password contains a blank or has characters that may interfere with OS command line processing:

--password "xxxx xx"

John Chapman September 6, 2012

I will give that another go, I had previously already tried that snapshot, however I did escape the characters (using Ruby's shellwords.escape) rather than using quotation marks so I will try ignoring that and just quoting them instead, however, can I point out that "double-quoting" the parameter will still result in argument expansion if you are using bash.

Additionally, it still does not clarify how you would handle characters such as a literal quotation mark.

John Chapman September 10, 2012

I've confirmed that works (in 2.7.0-SNAPSHOT), although my comment regarding "what if the password contains a quote character?" still stands, however that is a less common case, but that works for me as it is, thanks!

Bob Swift OSS (Bob Swift Atlassian Apps)
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 10, 2012

Good. Yes, I think double quote still needs to be avoided.

Matt Geis September 11, 2012

What if you're using the "addComment" action, and the comment itself has a double quote? I understand that in some cases avoiding a double quote is a good idea, but for something like a comment (not an edge case at all), it should be supported.

0 votes
Bob Swift OSS (Bob Swift Atlassian Apps)
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 5, 2012

JIRA Command Line Interface has an exportData action that can help with some of the project data, but not the workflow related stuff.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events