Uploaded image for project: 'Jira Align'
  1. Jira Align
  2. JIRAALIGN-4732

API 1.0: PUT request fails on users endpoint if "TeamRoleId"=-1

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Low
    • 10.120.0
    • 10.116.2
    • REST API
    • 1
    • Severity 3 - Minor
    • No

    Description

      Issue Summary

      Program or Solution team role not set will result in the message "Role with id -1 is not valid for this team.' when updating a User with the REST API 1.0.

      This is reproducible on Data Center: yes

      Steps to Reproduce

      1. Go to a program Team and add a member
      2. Make sure to not select a role as shown below:
      3. Use the GET method of the REST API 1.0 endpoint: https://<site-url>/api/Users/<userId> to retrieve the User information :
        Notice that the team role id is set to -1:
                    {
                        "TeamId": 2182,
                        "Name": "FXPProgram2 Team",
                        "TeamRole": {
                            "TeamRoleId": -1,
                            "Name": ""
                        }
                    }
        
      1. Use the PUT method of the REST API 1.0 endpoint: https:// <site-url>/api/Users/<userId> to update some of the User information (e.g. the title).
        For this take the entire JSON of the response of the GET method and modify one of the values (make sure to keep the teams' information in the JSON body of the PUT request.) 

      Expected Results

      As with API 2.0, the update is successfully done and no error is returned as we do not update the specific team with TeamRoleId=-1 nor do we try to set it to -1 (as it is already set).

      Actual Results

      The error below is thrown for any update made to the User record:

      "Role with id -1 is not valid for this team.'
      

      Workaround

      Use/Migrate API 2.0 instead of 1.0. The API 2.0 is the one we are consolidating.
      Make sure to select a role when adding a User to the members of a Program or Solution Team.

      Attachments

        Issue Links

          Activity

            People

              csmith1@atlassian.com Cap Smith
              646db21d89d1 Francois Panaget
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Backbone Issue Sync