with this command i get JSON output:
curl -s -H "Accept: application/json" -X GET "http://192.168.253.21:4440/api/20/project/test/executions?authtoken=kH44NoX35bp1zxohgkMtsOIC9H9tw6UI" | jq -r '.|[.executions[] | select(.job.name != null) | select(.job.name|contains("JIRA_Create_Subtask")) ] | sort_by(.id) | reverse | .[0] | [.status, .job.name, ."date-started".date, ."date-ended".date, .job.project]' > /tmp/1.txt
cat /tmp/1.txt
[
"succeeded",
"JIRA_Create_Subtask",
"2018-04-16T10:00:00Z",
"2018-04-16T10:00:02Z",
"test"
]
How to get this output in csv format:
"succeeded","JIRA_Create_Subtask","2018-04-16T10:00:00Z","2018-04-16T10:00:02Z","test"