How can I modify the User Name of a user via REST API or XOG?
search cancel

How can I modify the User Name of a user via REST API or XOG?

book

Article ID: 426680

calendar_today

Updated On:

Products

Clarity FedRAMP Clarity PPM On Premise Clarity PPM SaaS

Issue/Introduction

How can I modify the User Name of a user via REST API or XOG?

Resolution

REST API:

  1. Use a PATCH request with the new userName, keep the _internalId value.
    PATCH http(s)://<hostname:port>/ppm/rest/v1/users
    {"d":[{"userName":"newUserName","_internalId":5000001}]}

You can find the Internal ID in Classic Administration > Organization and Access > Resources > [user], then look at the URL:

http(s)://<hostname:port>/niku/nu#action:nmc.openUser&id=5000001&resourceId=5123456

 

XOG:

  1. Read the user via XOG to a file (use the cmn_users_read.xml file as template).
  2. Modify the userName attribute only and make sure to keep the oldUserName and userUid attributes unchanged with their original values. The userUid will get generated only once and is not modified in entire life cycle of a user.
    <NikuDataBus [...]>
      <Users>
        <User externalId=" " isLDAP="false" oldUserName="userName" uiThemeDefaultPartitionCode=" " userLanguage="English" userLocale="en_US" userName="newUserName" userStatus="ACTIVE" userTimezone="America/New_York" userType="INTERNAL" userUid="userName">
    [...]
      </Users>
    [...]
    </NikuDataBus>
  3. Use the modified file as XOG input.

Additional Information

KB 24124: Is it possible to change a Resource ID?