SharePoint / SharePoint/sp-dev-docs

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

Open
#9,928 3 comments 1 reaction 1 assignee View on GitHub

@Ashlesha-MSFT is already working on this.

Since Apr 23, 2025.

Needs: Triage :mag: sharepoint-developer-support type:bug-confirmed type:bug-suspected
Dominant language
PowerShell
Stars
1.4k
Forks
1.1k
Avg merge
4d 12h
Merged PRs (30d)
12

Description

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
  • 💥 Internet Explorer
  • 💥 Microsoft Edge
  • 💥 Google Chrome
  • 💥 FireFox
  • 💥 Safari
  • mobile (iOS/iPadOS)
  • mobile (Android)
  • not applicable
  • other (enter in the "Additional environment details" area below)
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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.