# DAYS\_SPENT\_IN\_STATE

### Description

`DAYS_SPENT_IN_STATE` returns the total number of days a case has spent (or has so far spent) in a given state, based on the case's transition history.

You can pass the state positionally or using the named argument `state`.

### Example

```
DAYS_SPENT_IN_STATE('in_review')
```

This returns the number of days the current case has spent in the `in_review` state.

### Example with named argument

```
DAYS_SPENT_IN_STATE(state: 'in_review')
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.atfinity.io/rule-language/operators/date-operators/days_spent_in_state.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
