SharePoint / sp-dev-docs

SharePoint & Viva Connections Developer Documentation
https://docs.microsoft.com/en-us/sharepoint/dev/
Creative Commons Attribution 4.0 International
1.24k stars 1k forks source link

_api/site/CreateCopyJobs does not work with file in multiple document sets #9928

Open Ed-Edf opened 2 days ago

Ed-Edf commented 2 days ago

Target SharePoint environment

SharePoint Online

What SharePoint development model, framework, SDK or API is this about?

SharePoint REST API

Developer environment

Windows

What browser(s) / client(s) have you tested

Additional environment details

Running an HTTP request to SharePoint in PowerAutomate

Describe the bug / error

When attempting to run the _api/site/CreateCopyJobs where the file in exportObjectUri exist in multiple documents sets a bad gateway error is returned. api works for files within the same document sets

Steps to reproduce

  1. Create 2 documentsets in a document library and add in files to both document sets
  2. Create a test flow in PowerAutomate
  3. Add in a Send an Http request to SharePoint action
  4. Set Site Address: https://contoso.sharepoint.com/sites/TestSite
  5. Set Method: Post
  6. Uri: _api/site/CreateJobs
  7. { "exportObjectUris": [
    "https://contoso.sharepoint.com/sites/TestSite/SharedDocuments/DocumentSet1/FileOne.pdf",
    "https://contoso.sharepoint.com/sites/TestSite/SharedDocuments/DocumentSet2/FileTwo.pdf"
    ], "destinationUri": "https://contoso.sharepoint.com/sites/TestSite/Test/ShareDocuments", "options": { "IgnoreVersionHistory": true, "IsMoveMode": false, "AllowSchemaMismatch": true, "NameConflictBehavior": 1 } }

image

image

result:

image

Expected behavior

Files from multiple document sets to be copied to destinationUri

stevebeauge commented 1 day ago

Maybe related : https://answers.microsoft.com/en-us/msoffice/forum/all/power-automate-copy-file-no-longer-works-copy/ec1d2469-85b0-4d84-8968-89781503a7b6 and https://stackoverflow.com/questions/78998402/power-automate-sharepoint-copy-file-error-invalid-value

I suspect a bad update inside the Copy api.