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

The JA API Creating the Mapping for the Projects, Doesn't Validate the ProjectId used on the POST Calls

XMLWordPrintable

    • 1
    • Severity 2 - Major
    • No

      Issue Summary

      The JA API that creates the mapping for the projects doesn't validate if the projectId used on the POST call is already mapped for that connector, allowing the creation of duplicate ids in JA and resulting in state mapping screen not loading.

      This is reproducible on Data Center: (yes) / (no)

      Steps to Reproduce

      1. Have an existent Jira project integrated with JA e.g."Laranja_5", "projectId": 10043
      2. Now Add a new project in JA using an existing e.g. "LARX", "projectId": 10043
      3. Run a GET API call to retrieve the list of Projects for the connector where both projects reside

       

      GET "https://ja_instance.jiraalign.com/rest/align/api/2/Connectors/4/projects"

       

      Expected Results

      No duplicated Jira Project ids are returned in the API call.

      Actual Results

      Duplicated Jira Project ids are returned in the API call and you can see the example created with the same projected 10043 as LAR5 on our lab instance alignsupporttest, which did break the state mapping for both:

       

      [
        {
          "id": 7,
          "projectId": 10043,
          "projectKey": "LAR5",
          "projectName": "Laranja_5",
          "programId": 49,
          "errorMessage": null,
          "connectorId": 1,
          "createdBy": null,
          "createDate": null,
          "lastUpdatedDate": null,
          "lastUpdatedBy": null
        },
        {
          "id": 25,
          "projectId": 10043,
          "projectKey": "LARX",
          "projectName": "Broken API Creation",
          "programId": 49,
          "errorMessage": null,
          "connectorId": 1,
          "createdBy": "1174",
          "createDate": "2023-08-07T12:26:40Z",
          "lastUpdatedDate": null,
          "lastUpdatedBy": null
        }
      ] 

       

       

      Workaround

      1. To remove the duplicated Projects from the JA connector mapping of the projects which are identified with the duplicate Project Ids
      2. The following API call can be used to remove the dups
      DELETE ​/align​/api​/2​/Connectors​/{connectorId}​/projects​/{projectid} 

            csmith1@atlassian.com Cap Smith
            55bc69081443 Edvaldo Lima
            Votes:
            2 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: