PHP Класс chobie\Jira\Api

Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$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.

Открытые методы

Метод Описание
__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.

Защищенные методы

Метод Описание
automapFields ( array $issue ) : array Automaps issue fields.
clearLocalCaches ( ) : void Helper method to clear the local caches. Is called when switching endpoints

Описание методов

__construct() публичный Метод

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() публичный Метод

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.
Результат chobie\Jira\Api\Result | false

api() публичный Метод

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.
Результат array | chobie\Jira\Api\Result | false

automapFields() защищенный Метод

Automaps issue fields.
protected automapFields ( array $issue ) : array
$issue array Issue.
Результат array

clearLocalCaches() защищенный Метод

Helper method to clear the local caches. Is called when switching endpoints
protected clearLocalCaches ( ) : void
Результат void

closeIssue() публичный Метод

Closes issue.
public closeIssue ( string $issue_key ) : Result | array
$issue_key string Issue key.
Результат chobie\Jira\Api\Result | array

createAttachment() публичный Метод

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.
Результат chobie\Jira\Api\Result | false

createIssue() публичный Метод

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.
Результат chobie\Jira\Api\Result | false

createVersion() публичный Метод

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.
Результат chobie\Jira\Api\Result | false

downloadAttachment() публичный Метод

Downloads attachment.
public downloadAttachment ( string $url ) : array | string
$url string URL.
Результат array | string

editIssue() публичный Метод

Edits the issue.
public editIssue ( string $issue_key, array $params ) : Result | false
$issue_key string Issue key.
$params array Params.
Результат chobie\Jira\Api\Result | false

findVersionByName() публичный Метод

Helper method to find a specific version based on the name of the version.
С версии: 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.
Результат array | null Version data on match or null when there is no match.

getAttachment() публичный Метод

Gets attachment.
public getAttachment ( string $attachment_id ) : array | false
$attachment_id string Attachment ID.
Результат array | false

getAttachmentsMetaInformation() публичный Метод

Gets attachments meta information.
С версии: 2.0.0
public getAttachmentsMetaInformation ( ) : array
Результат array

getCreateMeta() публичный Метод

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.
Результат array | false

getEndpoint() публичный Метод

Get Endpoint URL.
public getEndpoint ( ) : string
Результат string

getFields() публичный Метод

Get fields definitions.
public getFields ( ) : array
Результат array

getIssue() публичный Метод

Get specified issue.
public getIssue ( string $issue_key, string $expand = '' ) : Result | false
$issue_key string Issue key should be "YOURPROJ-221".
$expand string Expand.
Результат chobie\Jira\Api\Result | false

getIssueTypes() публичный Метод

Get available issue types.
public getIssueTypes ( ) : IssueType[]
Результат IssueType[]

getPriorities() публичный Метод

Get available priorities.
С версии: 2.0.0
public getPriorities ( ) : array
Результат array

getProject() публичный Метод

Returns one project.
public getProject ( string $project_key ) : array | false
$project_key string Project key.
Результат array | false

getProjectComponents() публичный Метод

Returns project components.
С версии: 2.0.0
public getProjectComponents ( string $project_key ) : array
$project_key string Project key.
Результат array

getProjectIssueTypes() публичный Метод

Get all issue types with valid status values for a project.
С версии: 2.0.0
public getProjectIssueTypes ( string $project_key ) : array
$project_key string Project key.
Результат array

getProjects() публичный Метод

Returns all projects.
public getProjects ( ) : Result | false
Результат chobie\Jira\Api\Result | false

getResolutions() публичный Метод

Returns a list of all resolutions.
С версии: 2.0.0
public getResolutions ( ) : array
Результат array

getRoleDetails() публичный Метод

Returns role details.
public getRoleDetails ( string $project_key, string $role_id ) : array | false
$project_key string Project key.
$role_id string Role ID.
Результат array | false

getRoles() публичный Метод

Returns all roles of a project.
public getRoles ( string $project_key ) : array | false
$project_key string Project key.
Результат array | false

getStatuses() публичный Метод

Get available statuses.
public getStatuses ( ) : array
Результат array

getTransitions() публичный Метод

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.
Результат chobie\Jira\Api\Result | false

getVersions() публичный Метод

Get versions of a project.
public getVersions ( string $project_key ) : array | false
$project_key string Project key.
Результат array | false

getWorklogs() публичный Метод

Get all worklogs for an issue.
С версии: 2.0.0
public getWorklogs ( string $issue_key, array $params ) : Result | false
$issue_key string Issue key should be "YOURPROJ-22".
$params array Params.
Результат chobie\Jira\Api\Result | false

releaseVersion() публичный Метод

Shorthand to mark a version as Released.
С версии: 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.
Результат false

setEndpoint() публичный Метод

Set Endpoint URL.
public setEndpoint ( string $url ) : void
$url string Endpoint URL.
Результат void

setOptions() публичный Метод

Sets options.
public setOptions ( integer $options ) : void
$options integer Options.
Результат void

setWatchers() публичный Метод

Set issue watchers.
public setWatchers ( string $issue_key, array $watchers ) : Result | false
$issue_key string Issue key.
$watchers array Watchers.
Результат chobie\Jira\Api\Result | false

transition() публичный Метод

Transition a ticket.
public transition ( string $issue_key, array $params ) : Result | false
$issue_key string Issue key should be "YOURPROJ-22".
$params array Params.
Результат chobie\Jira\Api\Result | false

updateVersion() публичный Метод

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.
Результат false

Описание свойств

$authentication защищенное свойство

Authentication.
protected AuthenticationInterface,chobie\Jira\Api\Authentication $authentication
Результат chobie\Jira\Api\Authentication\AuthenticationInterface

$client защищенное свойство

Client.
protected ClientInterface,chobie\Jira\Api\Client $client
Результат chobie\Jira\Api\Client\ClientInterface

$endpoint защищенное свойство

Endpoint URL.
protected string $endpoint
Результат string

$fields защищенное свойство

Client-side cache of fields. List of fields when loaded, null when nothing is fetched yet.
protected array|null $fields
Результат array | null

$options защищенное свойство

Options.
protected int $options
Результат integer

$priorities защищенное свойство

Client-side cache of priorities. List of priorities when loaded, null when nothing is fetched yet.
protected array|null $priorities
Результат array | null

$resolutions защищенное свойство

Client-side cache of resolutions. List of resolutions when loaded, null when nothing is fetched yet.
protected array|null $resolutions
Результат array | null

$statuses защищенное свойство

Client-side cache of statuses. List of statuses when loaded, null when nothing is fetched yet.
protected array|null $statuses
Результат array | null