Skip to content

SharePoint ​

Documents added to cases can be copied to one of your SharePoint document libraries, in a folder for each case named by its reference, so your SharePoint retention labels and searches include them. The case keeps its own documents and works from them: SharePoint gets a copy, and nothing comes back from SharePoint.

Before you start ​

  1. Register an app in Microsoft Entra ID with the Microsoft Graph application permission Sites.Selected, and give it admin consent.
  2. Grant the app write access on the one site, through Microsoft Graph (POST /sites/{site-id}/permissions).

Nothing wider, such as Sites.ReadWrite.All, is asked for, so the app can reach that site alone.

Settings ​

Admin → SharePoint:

Setting
Copy documents to SharePointOn or off
Site addressSuch as https://council.sharepoint.com/sites/Legal
LibraryThe document library's name on the site, such as Documents
FolderOptional: a folder in the library for the case folders, such as Cases/Legal
Directory (tenant) ID, Application (client) ID, Client secretFrom the app registration. The secret is stored encrypted and never shown again.
Which case typesChoose none to copy documents from every case type
Copy documents from restricted cases tooOff by default: people who can see the library may be people a restricted case is kept from
Also copy the documents already on casesOtherwise only documents added from when copying starts are copied

Choose Save settings. With copying on, saving finds the library straight away, so a wrong address, library or secret is shown against that setting.

What is copied ​

  • Every version of every document added to a case of the chosen types, from when copying starts (or everything, if chosen): uploads, letters, email attachments, redacted copies, bundles, signed copies and schedules alike.
  • Each document is a file in its case's folder, named by its title. A later version is uploaded as the next version of the same file, so the library's version history follows the case's. If someone deleted the file in SharePoint, the next version starts a new one.
  • Files of any size the case accepts are copied.

A document removed from a case keeps its copy. Making a case restricted later does not delete copies already made.

How copying runs ​

Every minute the system finds versions without a copy, queues them and sends them, retrying for about a day. The page shows the last copy made, how many have been made and how many are waiting, and the Latest copies, each with a link to the file.

If Microsoft Graph refuses the app, copying stops, with the reason, until the settings are saved again. Try the ones that gave up again retries those that ran out of attempts.

Editing in Microsoft 365 ​

Tick Let staff edit Word, Excel and PowerPoint documents in Microsoft 365 to give .docx, .xlsx and .pptx documents Edit in Microsoft 365. This works whether or not copying is on, with the same site, library and app.

When someone edits a document, it is checked out to them and its latest version is copied to a folder in this library: Folder for documents being edited, inside the folder above, or "Being edited". The app shares the copy with the person by their email address, without sending an invitation. Sharing needs the app to have full control of the site (Sites.Selected with the fullcontrol role); with only write access, staff need access to the library themselves. Saving and checking in read the copy back as the document's next version, and checking in removes the copy.

A restricted case's documents are edited this way only if Copy documents from restricted cases too is ticked, since the copy is in the library for as long as it is being edited.

A copy that cannot be taken down when someone checks in, because SharePoint is not answering, is tried again later, whether or not copying is on.

When a case is destroyed ​

When retention destroys a case, its copies are deleted from the library too (to the site's recycle bin). Until they have gone, the list of copies shows them as "(destroyed)" and being removed, naming neither the case nor the file, and nothing of them is kept after that.

Genera: case management for UK public sector organisations