# \_listBy

Lists Jobs using optional filters.

### Parameters

Note that at least one of the following optional filters must be set.

#### year

Integer year of the Job (OPTIONAL)

#### week

Integer week number of the Job (OPTIONAL)

uses [mode 1](https://dev.mysql.com/doc/refman/8.0/en/date-and-time-functions.html#function_week) of the MySQL week function

#### department\_id

Integer department ID (OPTIONAL)

#### assettype\_id

Integer asset-type ID (OPTIONAL)

#### status

Integer status of the Job (OPTIONAL)

#### last\_edited

Datetime returns jobs where last\_edited is greater than or equal to this (OPTIONAL)

### Example

```
FM_api('Jobs_listBy', [
	'status' => '2'
]);
```

### Result

```
{"appointments":[{"id":"50","customer_id":"208986","meeting_time":"2018-02-07 11:32:00"},{"id":"68","customer_id":"208986","meeting_time":"2018-02-28 19:12:00"},{"id":"71","customer_id":"215023","meeting_time":"2018-03-05 10:21:00"},{"id":"77","customer_id":"215023","meeting_time":"2018-03-09 14:01:00"},{"id":"90","customer_id":"208986","meeting_time":"2018-03-29 11:59:00"},{"id":"786","customer_id":"208986","meeting_time":"2018-04-23 14:27:00"},{"id":"787","customer_id":"208986","meeting_time":"2018-04-25 11:34:00"},{"id":"789","customer_id":"208986","meeting_time":"2018-04-26 12:28:00"}]}
```


---

# 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.fieldmotion.com/fieldmotion-api-docs/jobs/_listby.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.
