0

idを抽出したい場所

holder.parameter="jira-software-users" および "permission"="ADMINISTER_PROJECTS"

$.permissions[?(@.holder.parameter=="jira-software-users")]).id または $.permissions[?(@.permission=="ADMINISTER_PROJECTS")].id または組み合わせて使用​​しています彼ら

正しく動作していません。どうすれば同じことを達成できますか?https://jsonpath.com/でこれをテストしています

   {
    "permissions": [
        {
            "id": 10025,
            "self": "http://localhost:2990/jira/rest/api/2/permissionscheme/0/permission/10025",
            "holder": {
                "type": "projectRole",
                "parameter": "10002",
                "expand": "projectRole"
            },
            "permission": "MANAGE_WATCHERS"
        },
        {
            "id": 10004,
            "self": "http://localhost:2990/jira/rest/api/2/permissionscheme/0/permission/10004",
            "holder": {
                "type": "projectRole",
                "parameter": "10002",
                "expand": "projectRole"
            },
            "permission": "ADMINISTER_PROJECTS"
        },
        {
            "id": 10401,
            "self": "http://localhost:2990/jira/rest/api/2/permissionscheme/0/permission/10401",
            "holder": {
                "type": "projectRole",
                "parameter": "jira-software-users",
                "expand": "projectRole"
            },
            "permission": "MANAGE_SPRINTS_PERMISSION"
        },
        {
            "id": 10740,
            "self": "http://localhost:2990/jira/rest/api/2/permissionscheme/0/permission/10740",
            "holder": {
                "type": "group",
                "parameter": "jira-software-users",
                "expand": "group"
            },
            "permission": "ADMINISTER_PROJECTS"
        }
    ],
    "expand": "user,group,projectRole,field,all"
}
4

1 に答える 1

0

使ってもらいました

$.permissions..[?(@.permission=="ADMINISTER_PROJECTS" &&  @.holder.parameter=="jira-software-users")].id
于 2020-09-16T16:54:55.533 に答える