Creates a new task record. The $title and $status fields and the $assignedTo relationship are required.
If $createdBy is omitted it defaults to the authenticated user. The $note relationship is read-only — manage notes via their own relationships.
Supports idempotency via the Idempotency-Key header.
Required scope: tasks:create
Rate limit category: Write
Create a task
package main
import (
"context"
"fmt"
"github.com/Lightfld/lightfield-go"
"github.com/Lightfld/lightfield-go/option"
)
func main() {
client := githubcomlightfldlightfieldgo.NewClient(
option.WithAPIKey("My API Key"),
)
taskCreateResponse, err := client.Task.New(context.TODO(), githubcomlightfldlightfieldgo.TaskNewParams{
Fields: githubcomlightfldlightfieldgo.TaskNewParamsFields{
Status: "$status",
Title: "$title",
},
Relationships: map[string]githubcomlightfldlightfieldgo.TaskNewParamsRelationshipUnion{
"foo": githubcomlightfldlightfieldgo.TaskNewParamsRelationshipUnion{
OfString: githubcomlightfldlightfieldgo.String("string"),
},
},
})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", taskCreateResponse.ID)
}
{
"id": "id",
"createdAt": "createdAt",
"fields": {
"foo": {
"value": "string",
"valueType": "ADDRESS"
}
},
"httpLink": "httpLink",
"relationships": {
"foo": {
"cardinality": "cardinality",
"objectType": "objectType",
"values": [
"string"
]
}
},
"updatedAt": "updatedAt",
"externalId": "externalId"
}Returns Examples
{
"id": "id",
"createdAt": "createdAt",
"fields": {
"foo": {
"value": "string",
"valueType": "ADDRESS"
}
},
"httpLink": "httpLink",
"relationships": {
"foo": {
"cardinality": "cardinality",
"objectType": "objectType",
"values": [
"string"
]
}
},
"updatedAt": "updatedAt",
"externalId": "externalId"
}