Manage tasks

project-management/tasks@1.0.1
Supported by 1 provider
A

Create a new task in a project

Input
projects
title
description
parent
assignee
Result
ID of the created task.
URL of the created task

1.Choose a provider

2.Use CreateTask with mock in your code

npm i @superfaceai/one-sdk
const { SuperfaceClient } = require('@superfaceai/one-sdk');

const sdk = new SuperfaceClient();

async function run() {
  // Load the profile
  const profile = await sdk.getProfile('project-management/tasks@1.0.1');

  // Use the profile
  const result = await profile
    .getUseCase('CreateTask')
    .perform({
      project: '46ebca75-68af-42a1-916d-b228c2082d4f',
      title: 'Get milk',
      description: 'We ran out of milk :('
    }, {
      provider: 'mock'
    });

  // Handle the result
  try {
    const data = result.unwrap();
    console.log(data);
  } catch (error) {
    console.error(error);
  }
}

run();

Structure details

Input (object)

project
ID of project to create the task in.
title
Textual title of the task.
description
Free-form textual description of the task.
parent
ID of the parent task (if applicable).
assignee
ID of the user this task should be assigned to.

Example

{
  "project": "46ebca75-68af-42a1-916d-b228c2082d4f",
  "title": "Get milk",
  "description": "We ran out of milk :("
}

Result (object)

id
ID of the created task.
url
URL of the created task

Example

{
  "id": "ffa18e32-45e6-4b2b-97fa-b8509b3a8c76",
  "url": "https://example.com/tasks/ffa18e32-45e6-4b2b-97fa-b8509b3a8c76"
}

Implementation details

Provider
mock
Use case
CreateTask
Author
@superface
Source
Verified