У меня есть файл json и я хочу проанализировать его с помощью jq, чтобы в выводе было что-то вроде этого:
.issues.keys .project.self .fixVersions.id .fixVersions.name
.fixVersions.description .resolution.description .resolution.name .versions.name .summary.summary
А вот часть json:
[
{
"expand": "schema,names",
"startAt": 0,
"maxResults": 50,
"total": 56,
"issues": [
{
"key": "AXL-2766",
"fields": {
"issuetype": {
"self": "https://jira/rest/api/2/issuetype/1",
"description": "desc.",
},
"project": {
"self": "https://jira/rest/api/2/project/15770",
"avatarUrls": {
"48x48": "https://jira/secure/projectavatar?avatarId=15683",
}
},
"fixVersions": [
{
"self": "https://jira/rest/api/2/version/18167",
"description": "description1",
"name": "0.2.0",
}
],
"resolution": {
"self": "https://jira/rest/api/2/resolution/1",
"description": "description2",
"name": "Fixed"
},
"watches": {
"self": "https://jira/rest/api/2/issue/AXL-2766/watchers",
},
"created": "2019-03-04T01:10:07.000-0500",
"priority": {
"self": "https://jira/rest/api/2/priority/2",
},
"customfield_10420": null,
"customfield_12322": {
"self": "https://jira/rest/api/2/customFieldOption/10644",
},
"versions": [
{
"self": "https://jira/rest/api/2/version/18165",
"id": "18165",
"description": "",
"name": "0.0"
}
],
"issuelinks": [],
"assignee": {
"emailAddress": "aaa@domain.test"
},
"displayName": "user",
},
"updated": "2019-03-04T05:47:13.000-0500",
"status": {
"self": "https://jira/rest/api/2/status/5",
"description": "description3.",
"statusCategory": {
"colorName": "green",
"name": "Done"
}
},
"summary": "summary",
"creator": {
"self": "https://jira/rest/api/2/user?username=user",
"emailAddress": "user.@domain.net"
},
"subtasks": [],
"reporter": {
"self": "https://jira/rest/api/2/user?username=user",
"emailAddress": "user.@domain.net",
},
"aggregateprogress": {
"progress": 1800,
},
"customfield_10122": null,
"progress": {
"progress": 1800,
},
"votes": {
"self": "https://jira/rest/api/2/issue/AXL-2766/votes",
}
}
}
]
Я пробовал, нозастрял в этом:
. [] |{эмитенты: .issues, поля: [.fields .fixVersions .name]}
PS Файл json может быть поврежден, поскольку я удалил оттуда некоторую личную информацию:)