Announcing the SAVIYNT KNOWLEDGE EXCHANGE unifying the Saviynt forums, documentation, training, and more in a single search tool across platforms. Click HERE to read the Announcement.

How to update/changeService Account account owner using REST API

rashmirudrappa
New Contributor III
New Contributor III

Hi,

Service Now Application calls SAviynt REST api to create/update/enable/disable Service accounts in SAviynt.

We are trying remove existing owner and add new owner to Service Account using API and is not working. But from ARS owner change is working as expected. Why it is not working from API. Is there anything wrong in payload?

API Used: URL: https://*****.saviyntcloud.com/ECM/api/v5/createrequest

Payload:

{

 
    "username":"admin",
    "requesttype":"ADD",
    "endpoint":"Active Directory SA",
    "accountType":"Service Account",
    "securitysystem":"Active Directory SA",
    "comments":"testing",
    "accountname":"svr_77",
    "requestor":"admin",
    "dynamicattr":{
"dynAcclocation":"Aluminium - ASA"
}, 
     "owner": [
        {
            "ownerType""User",
            "name""SaviyntUser180",
            "rank""1",
            "updatetype""REMOVE"
 
        },
        {
            "ownerType""User",
            "name""SaviyntUser203",
            "rank""1",
            "updatetype""ADD"
 
        }
    ]
}

Please help.

 

Thank you

Rashmi

11 REPLIES 11

sk
All-Star
All-Star

When you say not working. Was the request is getting created or not? Also is there any error you are seeing ?


Regards,
Saathvik
If this reply answered your question, please Accept As Solution and give Kudos to help others facing similar issue.

rashmirudrappa
New Contributor III
New Contributor III

Hi SK,

No error as such. The request is generated and updateAccount Task is also generated. When we run AD provisioning job, the new owner information is not updated in AD. We could still see old owner information.

 

Thank you

Rashmi

Hi SK,

MApping in AD connector in CreateAccount Json.

"extensionAttribute10":"${ServiceAccountOwnerMap.get('USEROWNERS').get('1').collect{it.systemUserName.toString()}[0]}"
}

Thank you

Rashmi

Sorry I am confused you mentioned ServiceNOW service accounts but now you referring to AD accounts. Can you clarify on what is your target?

Also just want to confirm if owner on account is getting updated in Saviynt but not getting pushed/updated to target?


Regards,
Saathvik
If this reply answered your question, please Accept As Solution and give Kudos to help others facing similar issue.

rashmirudrappa
New Contributor III
New Contributor III

HI Sk,

Yes. owner on account is getting updated in Saviynt but not getting pushed/updated to target(AD).

pruthvi_t
Saviynt Employee
Saviynt Employee

Hi,

can you please elaborate on what error are you seeing in the response.

thanks


Regards,
Pruthvi

rushikeshvartak
All-Star
All-Star
  • updatetype - add/remove

It should be lowercase https://documenter.getpostman.com/view/1797923/2s83mbojGM#2d567827-c239-4c21-aa53-29c06c398a48


Regards,
Rushikesh Vartak
If you find the response useful, kindly consider selecting Accept As Solution and clicking on the kudos button.

Hi Rushi,

We tried lower case. The API response is successful when we use either lowercase or uppercase. Owner information is updated in Saviynt but not pushed to target which is AD.

 

What is your UPDATEACCOUNTJSON?


Regards,
Saathvik
If this reply answered your question, please Accept As Solution and give Kudos to help others facing similar issue.

rashmirudrappa
New Contributor III
New Contributor III

Hi SK,

MApping in AD connector in UPDATEACCOUNTJSON.

"extensionAttribute10":"${ServiceAccountOwnerMap.get('USEROWNERS').get('1').collect{it.systemUserName.toString()}[0]}"
}

Thank you

Rashmi

Do you seen any field under request_Access_attrs named as USEROWNERS for request raised by api


Regards,
Rushikesh Vartak
If you find the response useful, kindly consider selecting Accept As Solution and clicking on the kudos button.