JSONPath examples
This page is about Easy Integrations for Jira DC. Using Jira Cloud? Click the Cloud button above.
JSONPath is a powerful query language for navigating and extracting data from JSON documents. This guide provides practical examples to help you understand how to use JSONPath effectively.
Note that the JSONPath implementation uses Groovy's GPath syntax and is not to be confused with Jayway's JsonPath implementation.
Sample JSON data
Let's consider the following JSON response:
{"store":
[
{
"title": "Book One",
"price": 23
},
{
"title": "Book Two",
"price": 34
},
{
"title": "Book Three",
"price": 45
},
{
"title": "Book Four",
"price": 56
}
]
}Â
JSONPath expressions and results
The following table demonstrates JSONPath expressions and their corresponding results for the example JSON data:
JSONPath | Result |
---|---|
| 4 |
| Book One |
| Book Three |
| Book Four |
| 45 |
| 158 (which is 23 + 34 + 45 + 56) |