Magidoc

createGoal
Mutation

Creates a Hive goal with owners, targets, dates, sharing, and optional action, project, or subgoal measurements. Progress display accepts null, number, or actions measurements; number display also accepts overdue, while status display requires status measurement. Actions and overdue use actions/projects units, number uses currency/custom/percentage, and status uses subGoals. Custom unit values may be caller-defined; other values and symbols must match their unit type. Ongoing, recurring, and fixed date modes are mutually exclusive; fixed requires both dates with startDate before endDate.

Arguments

#

workspace

ID !
Non-null

The workspace ID where this goal will be created

owners

[ID !]!
Non-null

User IDs who own this goal (must contain at least one element; empty arrays are not allowed and will be rejected at runtime)

teamOwners

[ID !]!
Non-null

Team IDs who own this goal

name

Non-null

Goal name (cannot be empty string)

parentId

Parent goal ID if this is a sub-goal

description

Non-null

Goal description in HTML format

initialValue

Non-null

Initial numeric value for the goal

currentValue

Non-null

Current numeric value for the goal

goalValue

Non-null

Target numeric value for the goal

startDate

Start date (requires endDate if provided)

endDate

End date (required if startDate provided, must be after startDate)

ongoingDate

Whether goal is ongoing (cannot combine with recurringDate or start/endDate)

recurringDate

Recurring schedule (cannot combine with ongoingDate or start/endDate)

measurementType

How goal value is measured (null, number, actions, status, overdue)

measurementUnit

Unit for measurement (currency, percentage, custom, actions, projects, subGoals)

measurementUnitValue

Non-null

Specific value for the unit (e.g., 'USD', 'percentage', 'actions', 'projects', '' for subGoals)

measurementUnitSymbol

Non-null

Symbol for the unit (e.g., '$', '%', '€', '¥', '£', 'AU$')

displayType

Non-null

How goal is displayed (number, progress, status)

actionIds = []

[ID !]

Action IDs to track (requires measurementType actions/overdue + measurementUnit actions + measurementUnitValue 'actions')

includeSubActions

Whether to include sub-actions in tracking

projectIds = []

[ID !]

Project IDs to track (requires measurementType actions/overdue + measurementUnit projects + measurementUnitValue 'projects')

associatedProjectIds = []

[ID !]

Project IDs associated with the goal for dashboard/reporting filters (not measurement; independent of projectIds)

sharingType

Who can access this goal (me, custom, everyone)

sharingWith = []

[ID !]

User IDs to share with (only valid when sharingType is custom)

sourceWidgetId

PivotNumbers widget backing automated currentValue updates

isFixedLimit

Whether this number goal uses a fixed limit instead of expected progress by today.

isHigherBetter

Whether higher values are healthier for a fixed-limit goal.

statusWarningValue

Boundary above or below the fixed goal value. Values between them are at risk, including both boundaries.

statusUpdateMode

Status update mode

statusUpdateRange

Status update range rules

Response

#

Returns Goal .

Example

#