Uploaded image for project: 'Atlassian Intelligence'
  1. Atlassian Intelligence
  2. AI-234

Pages in renamed spaces show the previous name in search results when a rename is performed via the REST API

    XMLWordPrintable

Details

    • Severity 3 - Minor
    • 0

    Description

      Summary

      After renaming a space via a REST API call, the space reference in the search results shows the space name before a rename.

      Steps to Reproduce

      1. Create a new space called "[TEMP PREFIX] Test Cache Space 1"

      curl --request POST \
        --url '<instance>/wiki/rest/api/space' \
        --header 'Content-Type: application/json' \
        --data '{
      "key": "TPTCS1",
      "name": "[TEMP PREFIX] Test Cache Space 1"
      }' \
      --user <email>:<token>

       

      2. Copy a page to the new space

       

      curl --request POST \
        --url '<instance>/wiki/rest/api/content/<sourcePageId>/pagehierarchy/copy' \
        --header 'Content-Type: application/json' \
        --data '{
      "copyAttachments": true,
      "copyPermissions": true,
      "copyProperties": true,
      "copyLabels": true,
      "destinationPageId": "<targetSpaceHomePageId>"
      }' \
      --user <email>:<token>
      

      3. Rename the space to "Test Cache Space 1"

       

       

      curl --request PUT \
        --url '<instance>/wiki/rest/api/space/TPTCS1' \
        --header 'Content-Type: application/json' \
        --data '{
      "name": "Test Cache Space 1" 
      }' \
      --user <email>:<token>
      

       

       

      Expected Results

      The search results show the renamed space as space name so "Test Cache Space 1" in our example.

      Actual Results

      The search results show the space name before the rename.

      The screenshots show that the space name is "[TEMP PREFIX] Test Cache Space 1" in both the quick search and the advanced search results:

      Notes

      The same steps performed in the UI will show the renamed space name in the search results.

      This happens because the space name is indexed at the page level so a re-index of the pages is required for the space name to be updated. This explains why, after modifying a page, a new search will show the correct space name.

      Workaround

      Please reach out to Atlassian Support by using the following link and ask for a re-index: https://support.atlassian.com/contact/.

      Attachments

        Issue Links

          Activity

            People

              ywang2@atlassian.com Ying Wang
              ccurti Caterina Curti
              Votes:
              11 Vote for this issue
              Watchers:
              13 Start watching this issue

              Dates

                Created:
                Updated: