Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated deep-link creation logic in tab-request-approval. #1402

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -125,17 +125,17 @@ public async Task<ActionResult> SendNotificationToManager(RequestInfo taskInfo)
// Retrieve installed apps for the user from Microsoft Graph API
var installedApps = await graphClient.Users[user.Id].Teamwork.InstalledApps
.Request()
.Expand("teamsApp")
.Expand("teamsAppDefinition")
.GetAsync();

// Filter installed apps to find the one with DisplayName "Tab Request Approval"
var installationId = installedApps.Where(id => id.TeamsApp.DisplayName == "Tab Request Approval").Select(x => x.TeamsApp.Id);
var installationId = installedApps.Where(id => id.TeamsAppDefinition.DisplayName == "Tab Request Approval").Select(x => x.TeamsAppDefinition.Id);

// Check if there is at least one matching installationId
if (installationId.Any())
{
// Construct URL for the Teams entity
var url = "https://teams.microsoft.com/l/entity/" + installationId.ToList()[0] + "/request?context={\"subEntityId\":\"" + taskInfo.taskId + "\"}";
var url = "https://teams.microsoft.com/l/entity/" + _configuration["AzureAd:MicrosoftAppId"] + "/request?context={\"subEntityId\":\"" + taskInfo.taskId + "\"}";

// Create a TeamworkActivityTopic for the notification
var topic = new TeamworkActivityTopic
Expand Down