我正在关注json-
{
"issues": [{
"id": 200615,"custom_fields": [{
"id": 166,"name": "Severity","internal_name": null,"field_format": "list","value": "Major"
},{
"id": 167,"name": "Reproducibility","value": "Always"
},{
"id": 168,"name": "Resolution","value": "open"
}]
}]
}
从这个json中我想获取问题的值-> custome_fields-> id为167且期望值为的值-始终(167可以位于json中的任何位置,因此无法对其进行硬编码)
请问我如何实现价值?
jsonPath.get("issues[0].custom_fields[?(@.id == '167')].value[0]")
导致错误-
java.lang.IllegalArgumentException: Invalid JSON expression:
Script1.groovy: 1: expecting EOF,found '[' @ line 1,column 50.
Object.issues[0].custom_fields[?(@.id ==