Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Apparently no way to enter new lines in ticket body when creating ticket via slcli? #900

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
ulyssesbbg opened this issue Dec 5, 2017 · 1 comment · Fixed by #1316
Closed
Assignees
Labels

Comments

@ulyssesbbg
Copy link

For example:

slcli ticket create --title='TESTING - please ignore' --subject-id=1021 --body="Hello, we are testing to see if tickets can be '\n' created via slcli with line breaks '\n' in them for easier reading. There should be a line break here \n too. If you know of a way to do so via the slcli tool, please let us know. '\n\n' Thanks! '\n'

Expected Behavior

New lines inserted where \n or '\n' exists.

Actual Behavior

One long paragraph, with \n interpreted literally.

Environment Information

Operating System: macOS High Sierra 10.13.1 (17B1003)
slcli (SoftLayer Command-line), version 5.0.1

Am I using the wrong syntax or should this be possible? Softlayer's customer service tech asked if I could post here as she did not know how and nobody she asked knew either. I couldn't find specific mention of newlines at ticket creation time in the docs or code either.

@allmightyspiff
Copy link
Member

I know its been 3 years since you asked this question, but I finally got around to fixing it.

Newlines in the --body argument are going to be represented literally (as \n), and thats a side effect of how they are pulled out of the command line. Instead of regex-ing them back, I decided to allow for STDIN input as a sort of middle solution, for both ticket creation and updates. I've also updated the documentation to make this a lot more clear. Previously just omitting --body would open up a text editor so you could make nice updates, but that wasn't mentioned in the docs anywhere.

slcli ticket update 123456 --body="Some text"

Will update the ticket with Some text. Newlines here will show up literally.

cat sometfile.txt | slcli ticket update 123456

Will update the ticket with text from STDIN. This is the new behavior.

slcli ticket update 123456

Will open the default text editor, and once closed, use that text to update the ticket. Existed on old versions, but a bit better documented now.

Same applies for slcli ticket create

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants