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

    • 2
    • Severity 3 - Minor
    • 0

      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/.

            [AI-234] Pages in renamed spaces show the previous name in search results when a rename is performed via the REST API

            Hi 98a43c6ba569,

            I've just tried to use the REST APIs to perform a "dummy update" of the title of the page (using the same title already set) and that triggered the re-index of the content of the space name as well. I didn't specifically try with other fields, but any "content level" update will update the space name as well.

            Here is, as an example, how I've been updating the page:

            curl --request PUT \
              --url '<instance>/wiki/rest/api/content/<pageId>' \
              --header 'Accept: application/json' \
              --header 'Content-Type: application/json' \
              --data '{
              "version": {
                "number": 2
              },
              "title": "Page1 - from FirstSpace",
              "type": "page"
            }' \
            --user <email>:<token>
            

             

             

            As discussed in this thread, there isn't a scheduled reindexing that will occur in Confluence Cloud.

            Caterina Curti added a comment - Hi 98a43c6ba569 , I've just tried to use the REST APIs to perform a "dummy update" of the title of the page (using the same title already set) and that triggered the re-index of the content of the space name as well. I didn't specifically try with other fields, but any "content level" update will update the space name as well. Here is, as an example, how I've been updating the page: curl --request PUT \ --url '<instance>/wiki/ rest /api/content/<pageId>' \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --data '{ "version" : { "number" : 2 }, "title" : "Page1 - from FirstSpace" , "type" : "page" }' \ --user <email>:<token>     As discussed in this thread , there isn't a scheduled reindexing that will occur in Confluence Cloud.

            Can you recommend a specific workaround, using REST APIs, for apps that are running into this bug?

            Alternatively, it may be easier to fix the bug and release it now than to think about and implement workarounds in affected apps.  If this can't be fixed immediately we are going to need to explore workarounds for our app and we'd appreciate some advice.

            Thanks.

             

            Ture Hoefner added a comment - Can you recommend a specific workaround, using REST APIs, for apps that are running into this bug? Alternatively, it may be easier to fix the bug and release it now than to think about and implement workarounds in affected apps.  If this can't be fixed immediately we are going to need to explore workarounds for our app and we'd appreciate some advice. Thanks.  

              89dc7443aab8 Justin Dong
              ccurti Caterina Curti
              Affected customers:
              11 This affects my team
              Watchers:
              14 Start watching this issue

                Created:
                Updated: