pnp / pnp/powershell

[BUG] Import-PnPTermGroupFromXml command not updating Term Name even when UpdateBehavior is set to Overwrite

Open
#3,752 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
C#
Stars
904
Forks
407
Avg merge
9h 16m
Merged PRs (30d)
10

Description

Category
[x] Bug
[ ] Enhancement

Environment
[x] Office 365 / SharePoint Online

Reporting an Issue
Import-PnPTermGroupFromXml to update the name of term group and term, on a daily basis. Even when the attribute is set UpdateBehavior="Overwrite" in termgroup, the command does not update the Term Name, even if you have the same Term ID.

Expected or Desired Behavior
The Term Name should update based on the xml if the Term ID is matched.

Observed Behavior
The Term Name is not updated into term store if the Term ID is matched.

Steps to Reproduce
Create a sample XML file called test.xml:
<pnp:TermGroups xmlns:pnp="http://schemas.dev.office.com/PnP/2022/09/ProvisioningSchema">
<pnp:TermGroup Name="Test" ID="cd61a4d5-6fad-493b-81e2-958e3f3e6f21" Description="Test 123" UpdateBehavior="Overwrite">
pnp:TermSets
<pnp:TermSet Name="Type Level 1" Description="Test" Language="1033" ID="aa044f8f-874a-4b36-ad7f-fd21f815a36b">
<pnp:Terms />
</pnp:TermSet>
</pnp:TermSets>
</pnp:TermGroup>
</pnp:TermGroups>
Import it using command Import-PnPTermGroupFromXml -Path "test.xml"
Change the name of TermGroup and TermName
Import once again it using command Import-PnPTermGroupFromXml -Path "test.xml"

New Names are not updating

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.

Research direction

Start with the Import-PnPTermGroupFromXml command and inspect how UpdateBehavior="Overwrite" handles existing term IDs. Reproduce the issue with the supplied test.xml against SharePoint Online, then rerun the import after renaming the group and term and verify that both names update.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp, powershell
Domain
backend, cloud
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.