I want to create a spfx webpart to create a tasks in the teams channel
IS there any API for creating tasks in teams channel
Below is the image of my channel Task tab
I am new to Graph API Thanks in advance
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It only takes a minute to sign up.
Sign up to join this communityI want to create a spfx webpart to create a tasks in the teams channel
IS there any API for creating tasks in teams channel
Below is the image of my channel Task tab
I am new to Graph API Thanks in advance
You can use below endpoint to create new task inside any planner.
https://graph.microsoft.com/v1.0/planner/tasks
Request body
{
"planId": "xqQg5FS2LkCp935s-FIFm2QAFkHM",
"bucketId": "hsOf2dhOJkqyYYZEtdzDe2QAIUCR",
"title": "Update client list",
"assignments": {
"fbab97d0-4932-4511-b675-204639209557": {
"@odata.type": "#microsoft.graph.plannerAssignment",
"orderHint": " !"
}
}
}
Now if you noticed what you need is to find a plan Id for that particular channel's planner and its bucket id
Below are the steps you can follow to get
To get Plan Id - Open the planner in a particular channel and click on the website icon, this will open the planner in the browser and in the end, you will find the plan id
To get bucket ID
We would have to make the below API call
/planner/plans/{plan-id}/buckets
This will list down all the buckets inside the plan and you can find bucket id.
Use both above information to make actual create task call as mentioned in above step.
Hope this helps..