---
title: "init(targetTask:taskTitle:status:priority:spatialEventTrigger:temporalEventTrigger:)"
framework: intents
role: symbol
role_heading: Initializer
path: "intents/insettaskattributeintent/init(targettask:tasktitle:status:priority:spatialeventtrigger:temporaleventtrigger:)"
---

# init(targetTask:taskTitle:status:priority:spatialEventTrigger:temporalEventTrigger:)

Initializes the intent object with information about the task and the changes that you want to make.

## Declaration

```swift
init(targetTask: INTask?, taskTitle: INSpeakableString?, status: INTaskStatus, priority: INTaskPriority, spatialEventTrigger: INSpatialEventTrigger?, temporalEventTrigger: INTemporalEventTrigger?)
```

## Parameters

- `targetTask`: The task that you want to modify.
- `taskTitle`: The title for the task.
- `status`: The new status for the task.
- `priority`: The priority for the task.
- `spatialEventTrigger`: The location-based trigger, if any, that you want to apply to the task.
- `temporalEventTrigger`: The time-based trigger, if any, that you want to apply to the task.

## Return Value

Return Value An initialized intent object or nil if the object could not be created.

## Discussion

Discussion Normally, you do not create instances of this class yourself. Instead, SiriKit creates instances when the user asks to set the attributes of a task. However, you can use this method during testing to create intent objects in order to validate your intent handling code paths.

## See Also

### Initializing the Intent Object

- [init(targetTask:status:spatialEventTrigger:temporalEventTrigger:)](intents/insettaskattributeintent/init(targettask:status:spatialeventtrigger:temporaleventtrigger:).md)
