# Class: FilterClient

## FilterClient

## Constructor

#### new FilterClient(jiraClient)

Used to access Jira REST endpoints in '/rest/api/2/filter'

##### Parameters:

Name | Type | Description
--- | --- | ---
`jiraClient` | JiraClient |

Source:
  - api/filter.js, line 5

### Methods

#### createFilter(opts, callback)

Creates a new filter, and returns newly created filter. Currently sets permissions just using the users default sharing permissions

##### Parameters:

Name | Type | Description
--- | --- | ---
`opts` | Object | The request options sent to the Jira API ###### Properties
Name | Type | Attributes | Description
--- | --- | --- | ---
`expand` | Array | <optional> | The parameters to expand.
`filter` | Object |  | The filter to create. See https://docs.atlassian.com/jira/REST/latest/#d2e3347
`callback` |  | Called when the filter has been created.

Source:
  - api/filter.js, line 14

#### deleteFilter(opts, callback)

Delete a filter.

##### Parameters:

Name | Type | Description
--- | --- | ---
`opts` | Object | The request options sent to the Jira API ###### Properties
Name | Type | Description
--- | --- | ---
`filterId` | number | The id of the filter to delete
`callback` |  | Called when the filter has been deleted.

Source:
  - api/filter.js, line 76

#### getDefaultShareScore(opts, callback)

Returns the default share scope of the logged-in user.

##### Parameters:

Name | Type | Description
--- | --- | ---
`opts` |  | Ignored.
`callback` |  | Called when the default share scope has been retrieved.

Source:
  - api/filter.js, line 136

#### getFavouriteFilters(opts, callback)

Returns the favourite filters of the logged-in user.

##### Parameters:

Name | Type | Description
--- | --- | ---
`opts` |  | Ignored.
`callback` |  | Called when the list of favourites has been retrieved.

Source:
  - api/filter.js, line 177

#### getFilter(opts, callback)

Returns a filter given an id

##### Parameters:

Name | Type | Description
--- | --- | ---
`opts` | Object | The request options sent to the Jira API ###### Properties
Name | Type | Description
--- | --- | ---
`filterId` | number | The id of the filter to retrieve
`callback` |  | Called when the filter has been retrieved.

Source:
  - api/filter.js, line 46

#### getFilterColumns(opts, callback)

Returns the default columns for the given filter. Currently logged in user will be used as the user making such request.

##### Parameters:

Name | Type | Description
--- | --- | ---
`opts` | Object | The request options sent to the Jira API ###### Properties
Name | Type | Description
--- | --- | ---
`filterId` | number | The id of the filter for which to retrieve columns.
`callback` |  | Called when the columns have been retrieved.

Source:
  - api/filter.js, line 90

#### resetFilterColumns(opts, callback)

Resets the columns for the given filter such that the filter no longer has its own column config.

##### Parameters:

Name | Type | Description
--- | --- | ---
`opts` | Object | The request options sent to the Jira API ###### Properties
Name | Type | Description
--- | --- | ---
`filterId` | number | The id of the filter for which to reset columns.
`callback` |  | Called when the columns have been reset.

Source:
  - api/filter.js, line 122

#### setDefaultShareScope(opts, callback)

Sets the default share scope of the logged-in user.

##### Parameters:

Name | Type | Description
--- | --- | ---
`opts` | Object | The request options sent to jira ###### Properties
Name | Type | Description
--- | --- | ---
`scope` | string | The new default share scope. Available values are GLOBAL and PRIVATE.
`callback` |  | Called when the default share scope has been set.

Source:
  - api/filter.js, line 155

#### setFilterColumns(opts, callback)

Sets the default columns for the given filter

##### Parameters:

Name | Type | Description
--- | --- | ---
`opts` | Object | The request options sent to the Jira API ###### Properties
Name | Type | Description
--- | --- | ---
`filterId` | number | The id of the filter for which to update columns.
`columns` | Array | The names of the new columns. See https://docs.atlassian.com/jira/REST/latest/#d2e3460
`callback` |  | Called when the columns have been set

Source:
  - api/filter.js, line 105

#### updateFilter(opts, callback)

Updates an existing filter, and returns its new value.

##### Parameters:

Name | Type | Description
--- | --- | ---
`opts` | Object | The request options sent to the Jira API ###### Properties
Name | Type | Description
--- | --- | ---
`filterId` | number | The id of the filter to update
`filter` | Object | The new data for the filter. See https://docs.atlassian.com/jira/REST/latest/#d2e3401
`callback` |  | Called when the filter has been updated.

Source:
  - api/filter.js, line 60