// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Beta.Models;
var requestBody = new BusinessScenarioTask
{
Title = "Customer order #12010",
PercentComplete = 0,
Priority = 5,
Target = new BusinessScenarioGroupTarget
{
OdataType = "microsoft.graph.businessScenarioGroupTarget",
TaskTargetKind = PlannerTaskTargetKind.Group,
GroupId = "7a339254-4b2b-4410-b295-c890a16776ee",
},
BusinessScenarioProperties = new BusinessScenarioProperties
{
ExternalObjectId = "Order#12010",
ExternalContextId = "Warehouse-CA-36",
ExternalObjectVersion = "000001",
WebUrl = "https://ordertracking.contoso.com/view?id=12010",
ExternalBucketId = "deliveryBucket",
},
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.Solutions.BusinessScenarios["{businessScenario-id}"].Planner.Tasks.PostAsync(requestBody);
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
BusinessScenarioTask businessScenarioTask = new BusinessScenarioTask();
businessScenarioTask.setTitle("Customer order #12010");
businessScenarioTask.setPercentComplete(0);
businessScenarioTask.setPriority(5);
BusinessScenarioGroupTarget target = new BusinessScenarioGroupTarget();
target.setOdataType("microsoft.graph.businessScenarioGroupTarget");
target.setTaskTargetKind(PlannerTaskTargetKind.Group);
target.setGroupId("7a339254-4b2b-4410-b295-c890a16776ee");
businessScenarioTask.setTarget(target);
BusinessScenarioProperties businessScenarioProperties = new BusinessScenarioProperties();
businessScenarioProperties.setExternalObjectId("Order#12010");
businessScenarioProperties.setExternalContextId("Warehouse-CA-36");
businessScenarioProperties.setExternalObjectVersion("000001");
businessScenarioProperties.setWebUrl("https://ordertracking.contoso.com/view?id=12010");
businessScenarioProperties.setExternalBucketId("deliveryBucket");
businessScenarioTask.setBusinessScenarioProperties(businessScenarioProperties);
BusinessScenarioTask result = graphClient.solutions().businessScenarios().byBusinessScenarioId("{businessScenario-id}").planner().tasks().post(businessScenarioTask);
<?php
use Microsoft\Graph\Beta\GraphServiceClient;
use Microsoft\Graph\Beta\Generated\Models\BusinessScenarioTask;
use Microsoft\Graph\Beta\Generated\Models\BusinessScenarioGroupTarget;
use Microsoft\Graph\Beta\Generated\Models\PlannerTaskTargetKind;
use Microsoft\Graph\Beta\Generated\Models\BusinessScenarioProperties;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new BusinessScenarioTask();
$requestBody->setTitle('Customer order #12010');
$requestBody->setPercentComplete(0);
$requestBody->setPriority(5);
$target = new BusinessScenarioGroupTarget();
$target->setOdataType('microsoft.graph.businessScenarioGroupTarget');
$target->setTaskTargetKind(new PlannerTaskTargetKind('group'));
$target->setGroupId('7a339254-4b2b-4410-b295-c890a16776ee');
$requestBody->setTarget($target);
$businessScenarioProperties = new BusinessScenarioProperties();
$businessScenarioProperties->setExternalObjectId('Order#12010');
$businessScenarioProperties->setExternalContextId('Warehouse-CA-36');
$businessScenarioProperties->setExternalObjectVersion('000001');
$businessScenarioProperties->setWebUrl('https://ordertracking.contoso.com/view?id=12010');
$businessScenarioProperties->setExternalBucketId('deliveryBucket');
$requestBody->setBusinessScenarioProperties($businessScenarioProperties);
$result = $graphServiceClient->solutions()->businessScenarios()->byBusinessScenarioId('businessScenario-id')->planner()->tasks()->post($requestBody)->wait();
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph_beta import GraphServiceClient
from msgraph_beta.generated.models.business_scenario_task import BusinessScenarioTask
from msgraph_beta.generated.models.business_scenario_group_target import BusinessScenarioGroupTarget
from msgraph_beta.generated.models.planner_task_target_kind import PlannerTaskTargetKind
from msgraph_beta.generated.models.business_scenario_properties import BusinessScenarioProperties
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = BusinessScenarioTask(
title = "Customer order #12010",
percent_complete = 0,
priority = 5,
target = BusinessScenarioGroupTarget(
odata_type = "microsoft.graph.businessScenarioGroupTarget",
task_target_kind = PlannerTaskTargetKind.Group,
group_id = "7a339254-4b2b-4410-b295-c890a16776ee",
),
business_scenario_properties = BusinessScenarioProperties(
external_object_id = "Order#12010",
external_context_id = "Warehouse-CA-36",
external_object_version = "000001",
web_url = "https://ordertracking.contoso.com/view?id=12010",
external_bucket_id = "deliveryBucket",
),
)
result = await graph_client.solutions.business_scenarios.by_business_scenario_id('businessScenario-id').planner.tasks.post(request_body)