Creating Plot Twists
    Preparing search index...

    Type Alias Activity

    Activity: ActivityCommon & {
        source: string | null;
        title: string;
        type: ActivityType;
        assignee: Actor | null;
        done: Date | null;
        start: Date | string | null;
        end: Date | string | null;
        recurrenceUntil: Date | string | null;
        recurrenceCount: number | null;
        priority: Priority;
        recurrenceRule: string | null;
        recurrenceExdates: Date[] | null;
        recurrenceDates: Date[] | null;
        recurrence: Activity | null;
        occurrence: Date | null;
        meta: ActivityMeta | null;
    }

    Type Declaration

    • source: string | null

      Canonical URL for the item in an external system. For example, https://acme.atlassian.net/browse/PROJ-42 could represent a Jira issue. When set, it uniquely identifies the activity within a priority tree.

    • title: string

      The display title/summary of the activity

    • type: ActivityType

      The type of activity (Note, Task, or Event)

    • assignee: Actor | null

      The actor assigned to this activity.

      For actions (tasks):

      • If not provided (undefined), defaults to the user who installed the twist (twist owner)
      • To create an unassigned action, explicitly set assignee: null
      • For synced tasks from external systems, typically set assignee: null for unassigned items

      For notes and events: Assignee is optional and typically null.

      // Create action assigned to twist owner (default behavior)
      const task: NewActivity = {
      type: ActivityType.Action,
      title: "Follow up on email"
      // assignee omitted → defaults to twist owner
      };

      // Create UNASSIGNED action (for backlog items)
      const backlogTask: NewActivity = {
      type: ActivityType.Action,
      title: "Review PR #123",
      assignee: null // Explicitly set to null
      };

      // Create action with explicit assignee
      const assignedTask: NewActivity = {
      type: ActivityType.Action,
      title: "Deploy to production",
      assignee: {
      id: userId as ActorId,
      type: ActorType.User,
      name: "Alice"
      }
      };
    • done: Date | null

      Timestamp when the activity was marked as complete. Null if not completed.

    • start: Date | string | null

      Start time of a scheduled activity. Notes are not typically scheduled unless they're about specific times. For recurring events, this represents the start of the first occurrence. Can be a Date object for timed events or a date string in "YYYY-MM-DD" format for all-day events.

      Activity Scheduling States (for Actions):

      • Do Now (current/actionable): When creating an Action, omitting start defaults to current time
      • Do Later (future scheduled): Set start to a future Date or date string
      • Do Someday (unscheduled backlog): Explicitly set start: null

      Important for synced tasks: When syncing unassigned backlog items from external systems, set BOTH start: null AND assignee: null to create unscheduled, unassigned actions.

      // "Do Now" - assigned to twist owner, actionable immediately
      await this.tools.plot.createActivity({
      type: ActivityType.Action,
      title: "Urgent task"
      // start omitted → defaults to now
      // assignee omitted → defaults to twist owner
      });

      // "Do Later" - scheduled for a specific time
      await this.tools.plot.createActivity({
      type: ActivityType.Action,
      title: "Future task",
      start: new Date("2025-02-01")
      });

      // "Do Someday" - unassigned backlog item (common for synced tasks)
      await this.tools.plot.createActivity({
      type: ActivityType.Action,
      title: "Backlog task",
      start: null, // Explicitly unscheduled
      assignee: null // Explicitly unassigned
      });
    • end: Date | string | null

      End time of a scheduled activity. Notes are not typically scheduled unless they're about specific times. For recurring events, this represents the end of the first occurrence. Can be a Date object for timed events or a date string in "YYYY-MM-DD" format for all-day events. Null for tasks or activities without defined end times.

    • recurrenceUntil: Date | string | null

      For recurring activities, the last occurrence date (inclusive). Can be a Date object, date string in "YYYY-MM-DD" format, or null if recurring indefinitely. When both recurrenceCount and recurrenceUntil are provided, recurrenceCount takes precedence.

    • recurrenceCount: number | null

      For recurring activities, the number of occurrences to generate. Takes precedence over recurrenceUntil if both are provided. Null for non-recurring activities or indefinite recurrence.

    • priority: Priority

      The priority context this activity belongs to

    • recurrenceRule: string | null

      Recurrence rule in RFC 5545 RRULE format (e.g., "FREQ=WEEKLY;BYDAY=MO,WE,FR")

    • recurrenceExdates: Date[] | null

      Array of dates to exclude from the recurrence pattern

    • recurrenceDates: Date[] | null

      Array of additional occurrence dates to include in the recurrence pattern

    • recurrence: Activity | null

      For recurring event exceptions, points to the root recurring activity. Used when an individual occurrence of a recurring event is modified.

    • occurrence: Date | null

      For recurring event exceptions, the original occurrence date being overridden. Used to identify which occurrence of a recurring event this exception replaces.

    • meta: ActivityMeta | null

      Metadata about the activity, typically from an external system that created it