Skip to content

Complete channel API not work #13314

@richardmays999-prog

Description

@richardmays999-prog

Steps to reproduce

Hi

The issue I am reporting is extremely similar, if not exactly the same, as this issue raised over 4 years ago #2628 from tony-li-avepoint:

I am using MS Graph Powershell to do the following steps:

1) Create a Team in migration mode

# Connect to Graph
ConnectToMgGraph -TenantId "******" -ClientId "******" -ClientSecret "******"

# Create team in migration mode
$teamName = "Migration Test Friday 2"
$params = @{
                "template@odata.bind" = "https://graph.microsoft.com/v1.0/teamsTemplates('standard')"
                "@microsoft.graph.teamCreationMode" = "migration"
                displayName = "$teamName"
                description = "$teamName"
                visibility = "Private"
                firstChannelName = "General"
                createdDateTime = [System.DateTime]::Parse("2015-07-01T00:00:00.000Z")
            }
New-MgTeam -BodyParameter $params

# Need a small wait until the Team is available in Graph
Start-Sleep -Seconds 10
$team = Get-MgTeam -Filter "displayName eq '$teamName'"

2) Create team channel(s) in migration mode

$params = @{
		"@odata.type" = "#Microsoft.Graph.channel"
		"@microsoft.graph.channelCreationMode" = "migration"
		displayName = "Migration Channel 1"
		description = "Migration Channel 1"
		createdDateTime = [System.DateTime]::Parse("2015-07-02T00:00:00.000Z")
	}

# Create channel in migration mode
New-MgTeamChannel -TeamId $team.Id -BodyParameter $params
# Wait a bit, Graph likes to wait
Start-Sleep -Seconds 10

3) Populate migrated channel(s) with messages etc

I won't bother putting example calls here, as is not needed to show the issue.

4) Complete migration mode for channel(s) ('Complete-MgTeamChannelMigration')

# Get all the channels for the team and complete the migration
$channels = Get-MgAllTeamChannel -TeamId $team.Id
foreach($channel in $channels)
{
     try 
     {
            Write-Host "Channel `"$($channel.DisplayName)`" `"$($channel.Id)`" ..."
            Complete-MgTeamChannelMigration -TeamId $team.Id -ChannelId $channel.Id -ErrorAction Stop
            Write-Host "... completed"
     }
     catch
     {
         Write-Host "... FAILED: $($_.Exception.Message)"
     }
}

5) Complete migration mode for Team ('Complete-MgTeamMigration')

try 
{
    Write-Host "Team `"$($team.DisplayName)`" `"$($team.Id)`" ..."
    Complete-MgTeamMigration -TeamId $team.Id -ErrorAction Stop

    # Add members
    $params = @{
        "@odata.type" = "#microsoft.graph.aadUserConversationMember"
        "user@odata.bind" = "https://graph.microsoft.com/v1.0/users('some.one@somewhere.com')"
        roles = @(
                    "owner"
                )
    }

    Write-Host "Adding owner to team `"$($team.DisplayName)`" ..."
    New-MgTeamMember -TeamId $team.Id -BodyParameter $params -ErrorAction Stop
    Write-Host "... completed"
}
catch
{
    Write-Host "... FAILED: $($_.Exception.Message)"
}

Disconnect-Graph

Up until a couple of days ago, this was working absolutely fine, with no issues at all.

But now, the 'Complete-MgTeamChannelMigration' cmd (step 4), does not appear to be working. It reports success, or at least does not throw an error, but does not actually complete the channel migration. When 'Complete-MgTeamMigration' is run (step 5), it complains that all channels must be completed before the team can be completed, even though this is done in step 4.

If steps 4 and 5 are re-run on their own, step 4 shows apparent success again, even though the channels should have been completed on the first run. Previous to this issue occurring, the 'Complete-MgTeamChannelMigration' cmd would throw an error if called on a channel that had already been completed, but now it just continues with a success, again showing that it is not actually completing the channel migration.

The PowerShell Graph library is just a wrapper for the API, but I have tried the same using the API directly, and experience the same issue.

Any help would be appreciated, I'm assuming there must be some changes on the MS side?! This was working fine on Sept 10th and earlier, then when I tried it on the morning of Sept 11th, it stopped working!

Expected behavior

Channel migration is completed when the 'Complete-MgTeamChannelMigration' cmd is called.

Actual behavior

Channels are left in a migration status when the 'Complete-MgTeamChannelMigration' cmd is called.

Error details

No response

Metadata

Metadata

Assignees

Labels

teams-developer-supportQuestion related to extensibility (Bot, ME, Tab) would be marked under this label

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions