I have JSON that looks like this:
[
{
"fields": {
"versions": [
{
"id": "36143",
"name": "ST card"
},
{
"id": "36144",
"description": "Acceptance test card",
"name": "AT card"
}
],
"severity": {
"value": "B-Serious",
"id": "14231"
}
}
},
{
"fields": {
"versions": [
{
"id": "36145",
"name": "ST card"
}
],
"severity": {
"value": "C-Limited",
"id": "14235"
}
}
}
]
I want to convert it with jq to this:
[
{
"id": "36143",
"name": "ST card"
"value": "B-Serious"
},
{
"id": "36144",
"name": "AT card"
"value": "B-Serious"
},
{
"id": "36145",
"name": "ST card"
"value": "C-Limited"
}
]
Note that the first object has 2 versions, and the same severity. I have tried jq's group_by and map functions but haven't been too successful. Please help :)