PHP Class chobie\Jira\Api

Afficher le fichier Open project: chobie/jira-api-restclient Class Usage Examples

Protected Properties

Свойство Type Description
$authentication chobie\Jira\Api\Authentication\AuthenticationInterface Authentication.
$client chobie\Jira\Api\Client\ClientInterface Client.
$endpoint string Endpoint URL.
$fields array | null Client-side cache of fields. List of fields when loaded, null when nothing is fetched yet.
$options integer Options.
$priorities array | null Client-side cache of priorities. List of priorities when loaded, null when nothing is fetched yet.
$resolutions array | null Client-side cache of resolutions. List of resolutions when loaded, null when nothing is fetched yet.
$statuses array | null Client-side cache of statuses. List of statuses when loaded, null when nothing is fetched yet.

Méthodes publiques

Méthode Description
__construct ( string $endpoint, chobie\Jira\Api\Authentication\AuthenticationInterface $authentication, chobie\Jira\Api\Client\ClientInterface $client = null ) Create a JIRA API client.
addComment ( string $issue_key, array | string $params ) : Result | false Add a comment to a ticket.
api ( string $method = self::REQUEST_GET, string $url, array | string $data = [], boolean $return_as_array = false, boolean $is_file = false, boolean $debug = false ) : array | Result | false Send request to specified host.
closeIssue ( string $issue_key ) : Result | array Closes issue.
createAttachment ( string $issue_key, string $filename, string $name = null ) : Result | false Create attachment.
createIssue ( string $project_key, string $summary, string $issue_type, array $options = [] ) : Result | false Creates an issue.
createRemotelink ( string $issue_key, array $object = [], string $relationship = null, string $global_id = null, array $application = null ) : array | false Creates a remote link.
createVersion ( string $project_key, string $version, array $options = [] ) : Result | false Creates new version.
downloadAttachment ( string $url ) : array | string Downloads attachment.
editIssue ( string $issue_key, array $params ) : Result | false Edits the issue.
findVersionByName ( string $project_key, string $name ) : array | null Helper method to find a specific version based on the name of the version.
getAttachment ( string $attachment_id ) : array | false Gets attachment.
getAttachmentsMetaInformation ( ) : array Gets attachments meta information.
getCreateMeta ( array $project_ids = null, array $project_keys = null, array $issue_type_ids = null, array $issue_type_names = null, array $expand = null ) : array | false Returns the meta data for creating issues.
getEndpoint ( ) : string Get Endpoint URL.
getFields ( ) : array Get fields definitions.
getIssue ( string $issue_key, string $expand = '' ) : Result | false Get specified issue.
getIssueTypes ( ) : IssueType[] Get available issue types.
getPriorities ( ) : array Get available priorities.
getProject ( string $project_key ) : array | false Returns one project.
getProjectComponents ( string $project_key ) : array Returns project components.
getProjectIssueTypes ( string $project_key ) : array Get all issue types with valid status values for a project.
getProjects ( ) : Result | false Returns all projects.
getResolutions ( ) : array Returns a list of all resolutions.
getRoleDetails ( string $project_key, string $role_id ) : array | false Returns role details.
getRoles ( string $project_key ) : array | false Returns all roles of a project.
getStatuses ( ) : array Get available statuses.
getTransitions ( string $issue_key, array $params ) : Result | false Get available transitions for a ticket.
getVersions ( string $project_key ) : array | false Get versions of a project.
getWorklogs ( string $issue_key, array $params ) : Result | false Get all worklogs for an issue.
releaseVersion ( integer $version_id, string | null $release_date = null, array $params = [] ) : false Shorthand to mark a version as Released.
search ( string $jql, integer $start_at, integer $max_results = 20, string $fields = '*navigable' ) : Result | false Query issues.
setEndpoint ( string $url ) : void Set Endpoint URL.
setOptions ( integer $options ) : void Sets options.
setWatchers ( string $issue_key, array $watchers ) : Result | false Set issue watchers.
transition ( string $issue_key, array $params ) : Result | false Transition a ticket.
updateVersion ( integer $version_id, array $params = [] ) : false Updates version.

Méthodes protégées

Méthode Description
automapFields ( array $issue ) : array Automaps issue fields.
clearLocalCaches ( ) : void Helper method to clear the local caches. Is called when switching endpoints

Method Details

__construct() public méthode

Create a JIRA API client.
public __construct ( string $endpoint, chobie\Jira\Api\Authentication\AuthenticationInterface $authentication, chobie\Jira\Api\Client\ClientInterface $client = null )
$endpoint string Endpoint URL.
$authentication chobie\Jira\Api\Authentication\AuthenticationInterface Authentication.
$client chobie\Jira\Api\Client\ClientInterface Client.

addComment() public méthode

Add a comment to a ticket.
public addComment ( string $issue_key, array | string $params ) : Result | false
$issue_key string Issue key should be "YOURPROJ-221".
$params array | string Params.
Résultat chobie\Jira\Api\Result | false

api() public méthode

Send request to specified host.
public api ( string $method = self::REQUEST_GET, string $url, array | string $data = [], boolean $return_as_array = false, boolean $is_file = false, boolean $debug = false ) : array | Result | false
$method string Request method.
$url string URL.
$data array | string Data.
$return_as_array boolean Return results as associative array.
$is_file boolean Is file-related request.
$debug boolean Debug this request.
Résultat array | chobie\Jira\Api\Result | false

automapFields() protected méthode

Automaps issue fields.
protected automapFields ( array $issue ) : array
$issue array Issue.
Résultat array

clearLocalCaches() protected méthode

Helper method to clear the local caches. Is called when switching endpoints
protected clearLocalCaches ( ) : void
Résultat void

closeIssue() public méthode

Closes issue.
public closeIssue ( string $issue_key ) : Result | array
$issue_key string Issue key.
Résultat chobie\Jira\Api\Result | array

createAttachment() public méthode

Create attachment.
public createAttachment ( string $issue_key, string $filename, string $name = null ) : Result | false
$issue_key string Issue key.
$filename string Filename.
$name string Name.
Résultat chobie\Jira\Api\Result | false

createIssue() public méthode

Creates an issue.
public createIssue ( string $project_key, string $summary, string $issue_type, array $options = [] ) : Result | false
$project_key string Project key.
$summary string Summary.
$issue_type string Issue type.
$options array Options.
Résultat chobie\Jira\Api\Result | false

createVersion() public méthode

Creates new version.
public createVersion ( string $project_key, string $version, array $options = [] ) : Result | false
$project_key string Project key.
$version string Version.
$options array Options.
Résultat chobie\Jira\Api\Result | false

downloadAttachment() public méthode

Downloads attachment.
public downloadAttachment ( string $url ) : array | string
$url string URL.
Résultat array | string

editIssue() public méthode

Edits the issue.
public editIssue ( string $issue_key, array $params ) : Result | false
$issue_key string Issue key.
$params array Params.
Résultat chobie\Jira\Api\Result | false

findVersionByName() public méthode

Helper method to find a specific version based on the name of the version.
Since: 2.0.0
public findVersionByName ( string $project_key, string $name ) : array | null
$project_key string Project Key.
$name string The version name to match on.
Résultat array | null Version data on match or null when there is no match.

getAttachment() public méthode

Gets attachment.
public getAttachment ( string $attachment_id ) : array | false
$attachment_id string Attachment ID.
Résultat array | false

getAttachmentsMetaInformation() public méthode

Gets attachments meta information.
Since: 2.0.0
public getAttachmentsMetaInformation ( ) : array
Résultat array

getCreateMeta() public méthode

This includes the available projects, issue types and fields, including field types and whether or not those fields are required. Projects will not be returned if the user does not have permission to create issues in that project. Fields will only be returned if "projects.issuetypes.fields" is added as expand parameter.
public getCreateMeta ( array $project_ids = null, array $project_keys = null, array $issue_type_ids = null, array $issue_type_names = null, array $expand = null ) : array | false
$project_ids array Combined with the projectKeys param, lists the projects with which to filter the results. If absent, all projects are returned. Specifying a project that does not exist (or that you cannot create issues in) is not an error, but it will not be in the results.
$project_keys array Combined with the projectIds param, lists the projects with which to filter the results. If null, all projects are returned. Specifying a project that does not exist (or that you cannot create issues in) is not an error, but it will not be in the results.
$issue_type_ids array Combined with issuetypeNames, lists the issue types with which to filter the results. If null, all issue types are returned. Specifying an issue type that does not exist is not an error.
$issue_type_names array Combined with issuetypeIds, lists the issue types with which to filter the results. If null, all issue types are returned. This parameter can be specified multiple times, but is NOT interpreted as a comma-separated list. Specifying an issue type that does not exist is not an error.
$expand array Optional list of entities to expand in the response.
Résultat array | false

getEndpoint() public méthode

Get Endpoint URL.
public getEndpoint ( ) : string
Résultat string

getFields() public méthode

Get fields definitions.
public getFields ( ) : array
Résultat array

getIssue() public méthode

Get specified issue.
public getIssue ( string $issue_key, string $expand = '' ) : Result | false
$issue_key string Issue key should be "YOURPROJ-221".
$expand string Expand.
Résultat chobie\Jira\Api\Result | false

getIssueTypes() public méthode

Get available issue types.
public getIssueTypes ( ) : IssueType[]
Résultat IssueType[]

getPriorities() public méthode

Get available priorities.
Since: 2.0.0
public getPriorities ( ) : array
Résultat array

getProject() public méthode

Returns one project.
public getProject ( string $project_key ) : array | false
$project_key string Project key.
Résultat array | false

getProjectComponents() public méthode

Returns project components.
Since: 2.0.0
public getProjectComponents ( string $project_key ) : array
$project_key string Project key.
Résultat array

getProjectIssueTypes() public méthode

Get all issue types with valid status values for a project.
Since: 2.0.0
public getProjectIssueTypes ( string $project_key ) : array
$project_key string Project key.
Résultat array

getProjects() public méthode

Returns all projects.
public getProjects ( ) : Result | false
Résultat chobie\Jira\Api\Result | false

getResolutions() public méthode

Returns a list of all resolutions.
Since: 2.0.0
public getResolutions ( ) : array
Résultat array

getRoleDetails() public méthode

Returns role details.
public getRoleDetails ( string $project_key, string $role_id ) : array | false
$project_key string Project key.
$role_id string Role ID.
Résultat array | false

getRoles() public méthode

Returns all roles of a project.
public getRoles ( string $project_key ) : array | false
$project_key string Project key.
Résultat array | false

getStatuses() public méthode

Get available statuses.
public getStatuses ( ) : array
Résultat array

getTransitions() public méthode

Get available transitions for a ticket.
public getTransitions ( string $issue_key, array $params ) : Result | false
$issue_key string Issue key should be "YOURPROJ-22".
$params array Params.
Résultat chobie\Jira\Api\Result | false

getVersions() public méthode

Get versions of a project.
public getVersions ( string $project_key ) : array | false
$project_key string Project key.
Résultat array | false

getWorklogs() public méthode

Get all worklogs for an issue.
Since: 2.0.0
public getWorklogs ( string $issue_key, array $params ) : Result | false
$issue_key string Issue key should be "YOURPROJ-22".
$params array Params.
Résultat chobie\Jira\Api\Result | false

releaseVersion() public méthode

Shorthand to mark a version as Released.
Since: 2.0.0
public releaseVersion ( integer $version_id, string | null $release_date = null, array $params = [] ) : false
$version_id integer Version ID.
$release_date string | null Date in Y-m-d format (defaults to today).
$params array Optionally extra parameters.
Résultat false

setEndpoint() public méthode

Set Endpoint URL.
public setEndpoint ( string $url ) : void
$url string Endpoint URL.
Résultat void

setOptions() public méthode

Sets options.
public setOptions ( integer $options ) : void
$options integer Options.
Résultat void

setWatchers() public méthode

Set issue watchers.
public setWatchers ( string $issue_key, array $watchers ) : Result | false
$issue_key string Issue key.
$watchers array Watchers.
Résultat chobie\Jira\Api\Result | false

transition() public méthode

Transition a ticket.
public transition ( string $issue_key, array $params ) : Result | false
$issue_key string Issue key should be "YOURPROJ-22".
$params array Params.
Résultat chobie\Jira\Api\Result | false

updateVersion() public méthode

Updates version.
public updateVersion ( integer $version_id, array $params = [] ) : false
$version_id integer Version ID.
$params array Key->Value list to update the version with.
Résultat false

Property Details

$authentication protected_oe property

Authentication.
protected AuthenticationInterface,chobie\Jira\Api\Authentication $authentication
Résultat chobie\Jira\Api\Authentication\AuthenticationInterface

$client protected_oe property

Client.
protected ClientInterface,chobie\Jira\Api\Client $client
Résultat chobie\Jira\Api\Client\ClientInterface

$endpoint protected_oe property

Endpoint URL.
protected string $endpoint
Résultat string

$fields protected_oe property

Client-side cache of fields. List of fields when loaded, null when nothing is fetched yet.
protected array|null $fields
Résultat array | null

$options protected_oe property

Options.
protected int $options
Résultat integer

$priorities protected_oe property

Client-side cache of priorities. List of priorities when loaded, null when nothing is fetched yet.
protected array|null $priorities
Résultat array | null

$resolutions protected_oe property

Client-side cache of resolutions. List of resolutions when loaded, null when nothing is fetched yet.
protected array|null $resolutions
Résultat array | null

$statuses protected_oe property

Client-side cache of statuses. List of statuses when loaded, null when nothing is fetched yet.
protected array|null $statuses
Résultat array | null