# Class: ComponentClient

## ComponentClient

## Constructor

#### new ComponentClient(jiraClient)

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

##### Parameters:

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

Source:
  - api/component.js, line 5

### Methods

#### createComponent(opts, callback)

Create a component via POST.

##### Parameters:

Name | Type | Description
--- | --- | ---
`opts` |  | The request options sent to the Jira API ###### Properties
Name | Type | Description
--- | --- | ---
`component` |  | See https://docs.atlassian.com/jira/REST/latest/#d2e3871
`callback` |  | Called when the component has been created.

Source:
  - api/component.js, line 14

#### deleteComponent(opts, callback)

Delete a project component.

##### Parameters:

Name | Type | Description
--- | --- | ---
`opts` |  | The options sent to the Jira API ###### Properties
Name | Type | Attributes | Description
--- | --- | --- | ---
`id` |  |  | The id of the component to edit.
`moveIssuesTo` |  | <optional> | The new component applied to issues whose 'id' component will be deleted. If this value is null, then the 'id' component is simply removed from the related isues.
`callback` |  | Called when the component has been deleted.

Source:
  - api/component.js, line 80

#### editComponent(opts, callback)

Modify a component via PUT. Any fields present in the PUT will override existing values. As a convenience, if a field is not present, it is silently ignored. If leadUserName is an empty string ("") the component lead will be removed.

##### Parameters:

Name | Type | Description
--- | --- | ---
`opts` |  | The request options sent to the Jira API. ###### Properties
Name | Type | Description
--- | --- | ---
`id` |  | The id of the component to edit.
`component` |  | The new data to place in the component. See https://docs.atlassian.com/jira/REST/latest/#d2e3939
`callback` |  | Called when the component has beed edited.

Source:
  - api/component.js, line 35

#### getComponent(opts, callback)

Get a project component.

##### Parameters:

Name | Type | Description
--- | --- | ---
`opts` |  | The options sent to the Jira API ###### Properties
Name | Type | Description
--- | --- | ---
`id` |  | The id of the component to edit.
`callback` |  | Called when the component has been retrieved.

Source:
  - api/component.js, line 60

#### getRelatedIssueCounts(opts, callback)

Get counts of issues related to this component.

##### Parameters:

Name | Type | Description
--- | --- | ---
`opts` |  | The options sent to the Jira API ###### Properties
Name | Type | Description
--- | --- | ---
`id` |  | The id of the component to edit.
`callback` |  | Called when the count has been retrieved.

Source:
  - api/component.js, line 102