Class: ScreensClient

ScreensClient(jiraClient)

new ScreensClient(jiraClient)

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

Parameters:
Name Type Description
jiraClient JiraClient
Source:

Methods

addFieldToDefaultTab(opts, callbackopt) → {Promise}

Adds field or custom field to the default tab

Parameters:
Name Type Attributes 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 <optional>

Called when the tab has been moved.

Source:
Returns:

Resolved when the tab has been moved.

Type
Promise

addFieldToTab(opts, callbackopt) → {Promise}

Adds field to the given tab

Parameters:
Name Type Attributes 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 <optional>

Called when the fields have been added to the tab.

Source:
Returns:

Resolved when the fields have been added to the tab.

Type
Promise

createTab(opts, callbackopt) → {Promise}

Creates tab for given screen

Parameters:
Name Type Attributes 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 <optional>

Called when the tab has been created.

Source:
Returns:

Resolved when the tab has been created.

Type
Promise

deleteTab(opts, callbackopt) → {Promise}

Deletes the given tab from the given screen.

Parameters:
Name Type Attributes 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 <optional>

Called when data has been retrieved

Source:
Returns:

Resolved when data has been retrieved

Type
Promise

getAvailableFields(opts, callbackopt) → {Promise}

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

Parameters:
Name Type Attributes Description
opts Object

The request options sent to Jira

Properties
Name Type Description
screenId number

The id of the screen to retrieve.

callback <optional>

Called when the available fields have been retrieved

Source:
Returns:

Resolved when the available fields have been retrieved

Type
Promise

getFieldsInTab(opts, callbackopt) → {Promise}

Gets all fields for a given tab.

Parameters:
Name Type Attributes 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 <optional>

Called when the fields have been retrieved.

Source:
Returns:

Resolved when the fields have been retrieved.

Type
Promise

getTabs(opts, callbackopt) → {Promise}

Returns a list of all tabs for the given screen.

Parameters:
Name Type Attributes Description
opts Object

The request options sent to Jira

Properties
Name Type Description
screenId number

The id of the screen to retrieve.

callback <optional>

Called when the tabs have been retrieved.

Source:
Returns:

Resolved when the tabs have been retrieved.

Type
Promise

moveFieldOnTab(opts, callbackopt) → {Promise}

Move the given field on the given tab

Parameters:
Name Type Attributes 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 <optional>

Called when the field has been removed.

Source:
Returns:

Resolved when the field has been removed.

Type
Promise

moveTabPosition(opts, callbackopt) → {Promise}

Moves tab position

Parameters:
Name Type Attributes 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 <optional>

Called when the tab has been moved.

Source:
Returns:

Resolved when the tab has been moved.

Type
Promise

removeFieldFromTab(opts, callbackopt) → {Promise}

Remove the given field from the given tab.

Parameters:
Name Type Attributes 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 <optional>

Called when the field has been removed.

Source:
Returns:

Resolved when the field has been removed.

Type
Promise

renameTab(opts, callbackopt) → {Promise}

Renames the given tab on the given screen.

Parameters:
Name Type Attributes 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 <optional>

Called when data has been retrieved

Source:
Returns:

Resolved when data has been retrieved

Type
Promise