最佳答案
我得到以下输出使用: https://stackoverflow.com/a/40330344
(.issues[] | {key, status: .fields.status.name, assignee: .fields.assignee.emailAddress})
产出:
{
"key": "SEA-739",
"status": "Open",
"assignee": null
}
{
"key": "SEA-738",
"status": "Resolved",
"assignee": "user2@mycompany.com"
}
但是我需要解析每一行,但是就密钥组而言,很难确定哪个受让人是哪个密钥。这是否可能使用 jq 在一行中生成一束?
预期产出:
{ "key": "SEA-739", "status": "Open", "assignee": null }
{ "key": "SEA-738", "status": "Resolved", "assignee": "user2@mycompany.com"}
或者
{ "SEA-739", "Open", null }
{ "SEA-738", "Resolved", user2@mycompany.com }