Sign In Register

How can we help you today?

Start a new topic
Answered

Transferring Team Ownership

Hi,


I could find any reference to this in the documentation.


I would like to have teams persist even when the team leader leaves the team by transferring the ownership of the team to another team member. Is this possible and if so how can I achieve that.


Thanks,


Best Answer

Resolved this by digging through the API documentation object by object.


For future reference, changing team ownership can be done by fetching the team object in Cloud Code and calling setOwnerId.

For example:


// Get the Spark backing team object

var team = Spark.getTeams().getTeam( clan.teamId );

team.setOwnerId( clan.members[ newLeaderIndex ].id );

1 Comment

Answer

Resolved this by digging through the API documentation object by object.


For future reference, changing team ownership can be done by fetching the team object in Cloud Code and calling setOwnerId.

For example:


// Get the Spark backing team object

var team = Spark.getTeams().getTeam( clan.teamId );

team.setOwnerId( clan.members[ newLeaderIndex ].id );


1 person likes this
Login to post a comment