Hi
I am trying to add a comment to jira ticket using rest api 2
I tried to manually create json file by referring to jira developer site but while creating a json file using shell script getting error below
{"errorMessages":["Illegal unquoted character ((CTRL-CHAR, code 9)): has to be escaped using backslash to be included in string value\n at
I do not know where the problem with the Json is below
{"body": "
........................................
MEMORY UTILIZATION
Total Memory : MB
Available Memory : MB
Buffer+Cache Memory : MB
Free Memory : MB
Used Memory : MB
Memory Usage Percentage : %
MEMORY OK
........................................
........................................
CPU UTILIZATION
Number of Cores :4
Total CPU Load Average for the past 15 minutes :0.53,
CPU Usage % :76.90
........................................
end
"
}
If I add the same content to manually created json file it perfectly works.
Well, because you're pasting this in console right? The only thing the console sees is end of line, making that json invalid/broken/partial. What the message suggests is that you need to escape end of line if you want to include multi-line string. In bash, that would look like
{"body": "something \
multiline"}
And as the end of line is escaped, shell will interpret the multiline text properly.
All in all though you would probably be better off reading the json from file, rather than pasting it into a shell command directly.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.