User Provisioning REST API Patch User

Scott May 27, 2021

I can't seem to find details for the User provisioning API's patch user.  They give the following format:

 

{ "schemas": [ "<string>" ], "operations": [ { "op": "<string>", "path": "<string>", "value": { "array": true, "null": true, "valueNode": true, "containerNode": true, "missingNode": true, "object": true, "nodeType": "ARRAY", "pojo": true, "number": true, "integralNumber": true, "floatingPointNumber": true, "short": true, "int": true, "long": true, "double": true, "bigDecimal": true, "bigInteger": true, "textual": true, "boolean": true, "binary": true, "float": true } } ] }

 

Schemas: I think might be one (or all) of these

"urn:scim:schemas:extension:atlassian-external:1.0",        "urn:ietf:params:scim:schemas:core:2.0:User",        "urn:ietf:params:scim:schemas:extension:enterprise:2.0:User"

 

Operations.op: I have no idea what it is and there's no reference to a resource describing them.

Operations.path: Once again, I don't know the format.  Maybe  something like "name.familyName"?

Operations.value: If path points to the property, then I assume this is just the value for the property.

 

If I could get a real example or a resource that points out the missing information, that would help a ton.

1 answer

1 accepted

0 votes
Answer accepted
Scott May 27, 2021

I managed to figure this out.  For future reference,

schemas should be "urn:ietf:params:scim:api:messages:2.0:PatchOp". 

op valid values are: add, remove, replace.

path is the property path.  Ex: name.familyName

value is the string or json to add or replace.  You'd use JSON for something like the name property and string for something like name.familyName.

Mrinalini Pal July 29, 2021

Hi @Scott ,

I was looking for a working solution for the PATCH API. My API request is :

curl --request PATCH \
--url 'https://api.atlassian.com/scim/directory/{directoryId}/Users/{userId}' \
--header 'Authorization: Bearer <token>' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"schemas":[
"urn:ietf:params:scim:api:messages:2.0:PatchOp"
],
"operations": [
{
"op": "replace",
"path": "title",
"value": "Developer"
}
]
}'

I have created the user using POST API yesterday and trying to use PATCH to update it. However, I am not seeing any changes. 

Is there a mistake in my API call or do I need to wait for some time before the PATCH operation gives me the changes?

Scott July 29, 2021

Seems correct.  There is a small delay between the update in user provisioning and things updating in Jira.  But, it's not much.  I think a couple minutes at most, that I've noticed.  I'm not using the title field, so it could be something related to that.

Mrinalini Pal July 29, 2021

I was updating using the user provisioning api and also using the fetch api of provisioning to fetch the particular user. I just took an example of the title field, I tried using userName, name.givenName, name.familyName also but none of the changes were reflected. 

Scott July 29, 2021

Here's my C# code that updates the name.

sshot-1.png

Like Mrinalini Pal likes this
Mrinalini Pal July 29, 2021

In the response of this api are you seeing the values updated?

Scott July 29, 2021

So, the response from the call, I don't do anything with it.  So, I don't know about that.  As far as does it make a change in Jira, I checked my logs and have a last name change that happened on the 21st that shows updated in Jira.

Mrinalini Pal August 10, 2021

I understood why I was not seeing any changes. I was trying to perform the PATCH operation on users having emails outside the domain. The PATCH operation is working fine for the users within the domain.

Thanks for your help!

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
TAGS
AUG Leaders

Atlassian Community Events