Jun 11 2021 07:32 AM
Hello,
we are looking for a solution to add a Teams group to a project in "Project for the Web" with a flow.
In the web we have just to select the group and click on "Add" like in the screenshot:
Now we have a flow which creates a Teams team (it works fine) and we want to add the created team to a project in PftW.
We tried it with the standard Dataverse connectors but didnt find the correct field for this:
We also checked the new API: https://docs.microsoft.com/en-us/dynamics365/project-operations/project-management/schedule-api-prev...
Is it possible to add a team to the project with a flow?
Thanks in advance
Elmir
Jan 11 2022 03:36 AM
Jan 21 2022 12:00 AM
Feb 02 2022 10:16 AM
@elmirt Did you find a solution to this issue. We are also trying to find an automated way to integrate in teams.
Feb 03 2022 03:02 AM - edited Feb 03 2022 03:02 AM
@elmirt We are in the same situation. If you do this via the web interface, the "ownerid" and "owningteam" values are updated in the "msdyn_projects" entity.
The AAD group is then connected to a team (entity teams). If I do the whole thing via HTTP-PATCH, the attributes are also set accordingly, but the group is still not displayed as connected in the web interface.
Feb 25 2022 01:38 AM - edited Feb 25 2022 01:39 AM
We have now solved the whole thing using an Azure Function (within a Logic App) and corresponding C# code.
We create a team and link it to an AAD group. The team is then assigned the appropriate security role. (https://docs.microsoft.com/en-us/dynamics365/customerengagement/on-premises/developer/org-service/sa...)
var projectteam = new Entity("team", Guid.NewGuid());
projectteam["name"] = officeGroupName;
projectteam["businessunitid"] = new EntityReference("businessunit",Guid.Parse("GUID_BUSINESSUNIT_HERE"));
projectteam["azureactivedirectoryobjectid"] = officeGroupId;
projectteam["teamtype"] = 3;
projectteam["membershiptype"] = 0;
projectteam.Id = crmServiceClient.Create(projectteam);
// Add the role to the team.
crmServiceClient.Associate(
"team",
projectteam.Id,
new Relationship("teamroles_association"),
new EntityReferenceCollection() { new EntityReference("role", Guid.Parse("SEC-ROLE-GUID-HERE")) });
We then create the project with the API "msdyn_CreateProjectV1". Here we then set the "ownerid" to the ID of the created team.
project["ownerid"] = new EntityReference("team", Guid.Parse(projectteam.Id.ToString()));
It takes some time until the connection is shown in P4W.
Feb 25 2022 10:10 AM
Hello @PatrickGrebe,
I use Power Automate to update the ownerid field from the entity msdyn_project with the teamid field located in the entity "Team" but it still does not update this change on Project for the web:
Feb 28 2022 03:02 AM
Feb 28 2022 03:10 AM
Hello @PatrickGrebe,
Thanks for your response. As you said, it took a while but now I see the project it's being assigned to the team!
Could you explain me which role and how I must assign it to the Team? Do you refer the "team" entity record or the AAD Group?
Thanks in advance,
Feb 28 2022 06:47 AM
Jun 17 2022 04:58 AM - edited Jun 17 2022 05:20 AM
Anyone has an idea how to give prvCreateTeam permissions to the Teams table? I've granted full permissions in the default environment Business Management Section but I keep getting below error:
{"error":{"code":"0x80040220","message":"Principal user (Id=c2500728-e5e7-ec11-bb3c-0022489f76c6, type=8, roleCount=4, privilegeCount=256, accessMode=0), is missing prvCreateTeam privilege (Id=4807b998-6b4f-4d57-9cf6-515f50e43d79) on OTC=9 for entity 'team' (LocalizedName='Team').
context.Caller=c2500728-e5e7-ec11-bb3c-0022489f76c6. Or identityUser.SystemUserId=d9e8da9f-e1e7-ec11-bb3c-0022489f76c6, identityUser.Privileges.Count=260, identityUser.Roles.Count=4 is missing prvCreateTeam privilege (Id=4807b998-6b4f-4d57-9cf6-515f50e43d79) on OTC=9 for entity 'team' (LocalizedName='Team')."}}
EDIT:
I managed to solve the issue, I'm delegating to a licensed service account but the application registration user also needed permissions on the Teams table.
Aug 26 2022 08:12 AM
Hi Patrick,
Is the mechanism you described still functional? We tried the exact same steps through code in order to create and assign a P4TW project, using the exact steps (Create a group, create a Team with reference to the group, assign a role to a team, create the project with the team as the owner), however while the project is created successfully, along with the group and the respective teams and roles, we still don't get to see it "linked" to the newly created Group (even after several hours).
The user has to open the project and manually and link the project with the group:
We compared the rows created in the dataverse from manual assignment, to the ones auto created by our code and they are exactly the same. Are we missing any step?
Thanks
Aug 29 2022 12:32 PM
@SpyrosM1980 Hi, the whole thing works smoothly for us as I described above. (just tested)
We create the Office365 group via LogicApp. Then we wait about 2 minutes before we create the team in Dynamics and connect it to the Office365 group. (via Azure Function)
It takes between 15-60 minutes until the connection is displayed correctly in P4W.
Aug 29 2022 04:28 PM
Aug 30 2022 09:16 AM
Jul 14 2023 07:11 AM
Hi Patrick, I am trying to implement the whole thing in PowerAutomate.
1. first I create the team.
2. wait 2min
3. add an entry in the Dataverse table "Teams" (see second screenshot)
4. after that I create the project in the table "projects" with the TeamID as owner.
I seem to be missing the step where I add the role "Project Team Member" to the team. Unfortunately I have no idea where to find this.
Do you have a hint for me please?
Here is the error message I get:
"URL was not parsed due to an ODataUnrecognizedPathException. Resource not found for the segment provided in the URL."
I think this suggests that a relation is missing to another table? Probably owner?
Jul 18 2023 04:50 AM
@PhilippS1Hello, we have never tried it via Power Automate, so I cannot assist you further here. Unfortunately, I don't have the time to reproduce the whole thing. Perhaps an Unbound Action might help in this case.
Jul 19 2023 02:17 AM - edited Jul 19 2023 02:31 AM
Hello @PhilippS1,
I did it using Power Automate.
On Dataverse, the Team table will automatically add the Team you recently created. But if you want you can add it by yourself.
Then you will need to relate this Team with Team roles associations: Project Team Memeber and Project Common.
Here is how I have done it using a "Relate Action" (In Spanish..):
1. Table name: Teams
2. Row Id: Your Team Id
3. Relate: Team Role Associaton table
4. Relate with: https://[Your dynamics URL]/api/data/v9.1/roles(ROLE ID), where the role ID you should copy it from your "Team Roles" Dataverse table.
Hope it helps!!
Jul 19 2023 05:12 AM
Thank you very much for your help! I appreciate it!
Unfortunately I have no success. For me it does not create a row in the dataverse table "Table" after the creation of the team.
I have then set the entry once manually, unfortunately without success. Here once my flow:
In the actions that are used to relate the role, I used the team ID that I got from the action before. Not the team ID, which I received in the first action.
If it is not too much effort for you and you find time, could you show me your whole flow? I can understand if it is too much work though.
Aug 01 2023 04:46 AM