0

I'm using jq to parse the value but not getting expected results, can anyone please suggest me contents are

{
  "id": "8a9o0laf3ff0",
  "displayId": "8a0a",
  "author": {
    "name": "Rahul",
    "emailAddress": "donotreply@mail.com"
  },
  "authorTimestamp": 1524168139000,
  "message": "SD-90",
  "parents": [
    {
      "id": "8c1679f0813c",
      "displayId": "8c0f",
      "author": {
        "name": "Sahotay",
        "emailAddress": "donotreply@mail.com"
      },
      "authorTimestamp": 1523544887000,
      "message": "Fixing issues in SD-88",
      "parents": [
        {
          "id": "d022838cf4e6",
          "displayId": "d0a3"
        }
      ]
    }
  ],
  "properties": {
    "jira-key": [
      "SD-90"
    ]
  }
}

I would like to grab value of jira-key

jq '.properties' myjason.json
{
  "jira-key": [
    "SD-90"
  ]
}

but if i'm using .jira-key[] its not working

peak
  • 105,803
  • 17
  • 152
  • 177
Rahul Sahotay
  • 155
  • 1
  • 11

1 Answers1

0

you can use this

jq '.properties["jira-key"]' test.json

otherwise jq parses dash as a subtraction

yausername
  • 750
  • 5
  • 15