Issue with PATCH Operation Replacing Instead of Adding to Membership Criteria

Hello SailPoint Community,

I’ve encountered an issue while attempting to use the PATCH API to update a role’s membership criteria. My intention is to add new criteria to the ‘/membership/criteria/children’ path, but instead of adding, it seems to replace the existing membership criteria. Here’s the JSON payload I used:

[
    {
        "op": "add",
        "path": "/membership/criteria/children",
        "value": [
            {
                "operation": "EQUALS",
                "key": {
                    "type": "IDENTITY",
                    "property": "attribute.empidcheck",
                    "sourceId": null
                },
                "stringValue": "Y",
                "children": null
            }
        ]
    }
]

Based on my understanding, the add operation should append the new criteria to the existing list at the specified path. However, it appears to behave more like a replace operation, overwriting any existing criteria.

I’ve reviewed the documentation but couldn’t find a clear explanation for this behavior. I’m wondering if I might be misunderstanding the expected behavior of the ‘add’
operation in this context or if there might be a specific way to format the request to achieve the intended result.

Questions:

  1. Is the observed behavior expected when using the ‘add’ operation with the PATCH API for the ‘/membership/criteria/children’ path?
  2. If it’s expected, could you please advise on how to properly add new criteria without replacing the existing ones?
  3. Are there examples or best practices for updating membership criteria using PATCH that I might have overlooked?

I appreciate any guidance or insights you can provide on this matter. Thank you in advance for your help!

Best regards, Joy

When using the add operation on a list, you have to specify the index where you want to add the item. If you want to add the item at the beginning of the list, use the following path:

"path": "/membership/criteria/children/0"

If you want to add the item to the end of the list, use the following path:

"path": "/membership/criteria/children/-"

4 Likes

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.