# Class: ScreensClient

## ScreensClient

## Constructor

#### new ScreensClient(jiraClient)

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

##### Parameters:

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

Source:
  - api/screens.js, line 5

### Methods

#### addFieldToDefaultTab(opts, callback)

Adds field or custom field to the default tab

##### Parameters:

Name | Type | Description
--- | --- | ---
`opts` | Object | The request options sent to the Jira API. ###### Properties
Name | Type | Description
--- | --- | ---
`fieldId` | string | The id of the field to add to the default tab.
`callback` |  | Called when the tab has been moved.

Source:
  - api/screens.js, line 173

#### addFieldToTab(opts, callback)

Adds field to the given tab

##### Parameters:

Name | Type | Description
--- | --- | ---
`opts` | Object | The request options sent to the Jira API ###### Properties
Name | Type | Description
--- | --- | ---
`screenId` | number | The id of the screen containing the tab.
`tabId` | number | the id of the tab to which the fields will be added.
`fieldId` | string | The field to add
`callback` |  | Called when the fields have been added to the tab.

Source:
  - api/screens.js, line 88

#### createTab(opts, callback)

Creates tab for given screen

##### Parameters:

Name | Type | Description
--- | --- | ---
`opts` | Object | The request options sent to Jira ###### Properties
Name | Type | Description
--- | --- | ---
`screenId` | number | The id of the screen in which to create a tab.
`name` | string | The name of the tab to add. Minimum required to create a tab.
`callback` |  | Called when the tab has been created.

Source:
  - api/screens.js, line 42

#### deleteTab(opts, callback)

Deletes the given tab from the given screen.

##### Parameters:

Name | Type | Description
--- | --- | ---
`opts` | Object | The request options sent to the jira API ###### Properties
Name | Type | Description
--- | --- | ---
`screenId` | number | The id of the screen containing the tab to delete.
`tabId` | number | The id of the tab to delete
`callback` |  |

Source:
  - api/screens.js, line 73

#### getAvailableFields(opts, callback)

Gets available fields for screen. i.e ones that haven't already been added.

##### Parameters:

Name | Type | Description
--- | --- | ---
`opts` | Object | The request options sent to Jira ###### Properties
Name | Type | Description
--- | --- | ---
`screenId` | number | The id of the screen to retrieve.
`callback` |  | Called when the available fields have been retrieved

Source:
  - api/screens.js, line 14

#### getFieldsInTab(opts, callback)

Gets all fields for a given tab.

##### Parameters:

Name | Type | Description
--- | --- | ---
`opts` | Object | The request options sent to the Jira API ###### Properties
Name | Type | Description
--- | --- | ---
`screenId` | number | The id of the screen containing the tab.
`tabId` | number | the id of the tab for which to retrieve fields.
`callback` |  | Called when the fields have been retrieved.

Source:
  - api/screens.js, line 104

#### getTabs(opts, callback)

Returns a list of all tabs for the given screen.

##### Parameters:

Name | Type | Description
--- | --- | ---
`opts` | Object | The request options sent to Jira ###### Properties
Name | Type | Description
--- | --- | ---
`screenId` | number | The id of the screen to retrieve.
`callback` |  | Called when the tabs have been retrieved.

Source:
  - api/screens.js, line 28

#### moveFieldOnTab(opts, callback)

Move the given field on the given tab

##### Parameters:

Name | Type | Description
--- | --- | ---
`opts` | Object | The request options sent to the Jira API ###### Properties
Name | Type | Description
--- | --- | ---
`screenId` | number | The id of the screen containing the tab.
`tabId` | number | the id of the tab containing the field.
`fieldId` | string | The id of the field to remove from the tab.
`newPosition` | number | The position to which the field should be moved. May be one of: Earlier Later First Last
`callback` |  | Called when the field has been removed.

Source:
  - api/screens.js, line 135

#### moveTabPosition(opts, callback)

Moves tab position

##### Parameters:

Name | Type | Description
--- | --- | ---
`opts` | Object | The request options sent to the Jira API. ###### Properties
Name | Type | Description
--- | --- | ---
`screenId` | number | The id of the screen containing the tab.
`tabId` | number | the id of the tab to move.
`newPosition` | number | The new (zero-indexed) position of the tab.
`callback` |  | Called when the tab has been moved.

Source:
  - api/screens.js, line 157

#### removeFieldFromTab(opts, callback)

Remove the given field from the given tab.

##### Parameters:

Name | Type | Description
--- | --- | ---
`opts` | Object | The request options sent to the Jira API ###### Properties
Name | Type | Description
--- | --- | ---
`screenId` | number | The id of the screen containing the tab.
`tabId` | number | the id of the tab from which to remove the field.
`fieldId` | string | The id of the field to remove from the tab.
`callback` |  | Called when the field has been removed.

Source:
  - api/screens.js, line 119

#### renameTab(opts, callback)

Renames the given tab on the given screen.

##### Parameters:

Name | Type | Description
--- | --- | ---
`opts` | Object | The request options sent to the jira API ###### Properties
Name | Type | Description
--- | --- | ---
`screenId` | number | The id of the screen containing the tab to rename.
`tabId` | number | The id of the tab to rename
`name` | string | The new name of the tab.
`callback` |  |

Source:
  - api/screens.js, line 57