Uploaded image for project: 'Jira Data Center'
  1. Jira Data Center
  2. JRASERVER-67262

Updating roles through REST API did not work using username

    XMLWordPrintable

Details

    • Bug
    • Resolution: Duplicate
    • Low
    • None
    • 7.3.0, 7.6.3
    • REST API
    • None

    Description

      Summary:

      In case that a user has been renamed before where app_user table will have the user_key and lower_user_name different, if we use the REST Call to include a user into a certain project role, it will fail.

      Steps to reproduce:

      1. Cerate a User that able to log in to JIRA.
      2. Rename the User.
      3. Execute the REST Call below:
        POST /rest/api/2/project/{projectIdOrKey}/role/{id}
      4. For example,
        curl -X POST --data '{"user":["user1"]}' localhost:8730/jira/rest/api/2/project/BA/role/10002 -H 'Content-type: application/json' -H'Accept: application/json' -u admin:admin

      Expected Result:

      The user will be added to the role.

      Actual Result:

      This will be thrown instead:

      {"errorMessages":["We can't find 'user1' in any accessible user directory. Check they're still active and available, and try again."],"errors":{}}

      Workaround:

      Use the user user_key. To check the value, run the query below:

      select * from app_user where lower_user_name = '<affected username in lowercase>';

      Notes:

      • With JIRA Public REST API documentation did not specify which need to be used, the expected here is that the REST Call is possible to use the username
      • In any case, JIRA should be able to check the lower_user_name in app_user table what is the original username is.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              jrahmadiputra Julian (Inactive)
              Votes:
              1 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: