Get outputs from jq on a single line

-c is what you likely need

Using the output you posted above, you can process it further:

jq -c . input

To Give;

{"key":"SEA-739","status":"Open","assignee":null}
{"key":"SEA-738","status":"Resolved","assignee":"[email protected]"}

Or you can just change your original command

FROM

jq -r '(.issues[] | {key, status: .fields.status.name, assignee: .fields.assignee.emailAddress})'

TO

jq -c '(.issues[] | {key, status: .fields.status.name, assignee: .fields.assignee.emailAddress})'

Leave a Comment