PHPackages                             mi-lopez/jira-php - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. mi-lopez/jira-php

ActiveLibrary[API Development](/categories/api)

mi-lopez/jira-php
=================

Jira PHP is a supercharged PHP API client that allows you to interact with the Jira API and the Service Desk API

v0.1.1(2y ago)03MITPHPPHP ^8.1.0

Since Mar 9Pushed 2y agoCompare

[ Source](https://github.com/mi-lopez/jira-php)[ Packagist](https://packagist.org/packages/mi-lopez/jira-php)[ RSS](/packages/mi-lopez-jira-php/feed)WikiDiscussions 0.x Synced 1mo ago

READMEChangelog (1)Dependencies (10)Versions (3)Used By (0)

 [![Jira PHP](art/example.png)](art/example.png)

 [![GitHub Workflow Status (master)](https://camo.githubusercontent.com/4d518e8cb00eca18ad5c1e11d3e962c2b8c9485bf9ad4307d7823b355f655b13/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6465766d6f6174682f6a6972612d7068702f74657374732e796d6c3f6272616e63683d302e78)](https://github.com/devmoath/jira-php/actions) [![Total Downloads](https://camo.githubusercontent.com/88fdcb0cb8e6a947a5848f94f3cef223262c51f389fb84f7916d9e6b5035e1d3/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6465766d6f6174682f6a6972612d706870)](https://packagist.org/packages/devmoath/jira-php) [![Latest Version](https://camo.githubusercontent.com/97091e24dc23b7049088ed9b757bcfa7e02b4eecc737c5c1db4f0f819123e3e1/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6465766d6f6174682f6a6972612d706870)](https://packagist.org/packages/devmoath/jira-php) [![License](https://camo.githubusercontent.com/de883c8f67a25ff1e72dc56892a4a52272919ed1b37ffd6e4c9118c3ed5b92f2/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f6465766d6f6174682f6a6972612d706870)](https://packagist.org/packages/devmoath/jira-php)

---

**Jira PHP** is a supercharged PHP API client that allows you to interact with the [Jira API](https://docs.atlassian.com/software/jira/docs/api/REST/8.0.0) and the [Service Desk API](https://docs.atlassian.com/jira-servicedesk/REST/5.2.0/).

Get Started
-----------

[](#get-started)

> **Requires [PHP 8.1+](https://php.net/releases/)**

First, install `devmoath/jira-php` via the [Composer](https://getcomposer.org/) package manager:

```
composer require devmoath/jira-php
```

Then, interact with Jira's APIs:

```
$client = Jira::client('USERNAME', 'PASSWORD', 'jira.domain.com');

$result = $client->issues()->search();

echo $result['issues'][0]['key']; // KEY-1000
```

Usage
-----

[](#usage)

### `Attachments` Resource

[](#attachments-resource)

#### `get` function

[](#get-function)

Retrieve the meta-data for an attachment.

```
$client->attachments()->get(id: '1000');
```

response example```
[
    'self' => 'https://www.example.com/jira/rest/api/2.0/attachments/10000',
    'filename' => 'picture.jpg',
    'author' => [
        'self' => 'https://www.example.com/jira/rest/api/2/user?username=fred',
        'name' => 'fred',
        'avatarUrls' => [
            '48x48' => 'https://www.example.com/jira/secure/useravatar?size=large&ownerId=fred',
            '24x24' => 'https://www.example.com/jira/secure/useravatar?size=small&ownerId=fred',
            '16x16' => 'https://www.example.com/jira/secure/useravatar?size=xsmall&ownerId=fred',
            '32x32' => 'https://www.example.com/jira/secure/useravatar?size=medium&ownerId=fred',
        ],
        'displayName' => 'Fred F. User',
        'active' => false,
    ],
    'created' => '2019-02-09T10:08:20.478+0000',
    'size' => 23123,
    'mimeType' => 'image/jpeg',
    'content' => 'https://www.example.com/jira/attachments/10000',
    'thumbnail' => 'https://www.example.com/jira/secure/thumbnail/10000',
];
```

---

#### `remove` function

[](#remove-function)

Remove an attachment.

```
$client->attachments()->remove(id: '1000');
```

response example```
null
```

---

#### `download` function

[](#download-function)

Download an attachment content.

```
$attachment = $client->attachments()->get(id: '1000');

$client->attachments()->download(url: $attachment['content']);
```

response example```
{"a":"b"}\n

```

---

### `Customers` Resource

[](#customers-resource)

#### `create` function

[](#create-function)

Create a customer that is not associated with a service project.

```
$client->customers()->create(
    body: [
        'fullName' => 'name',
        'email' => 'name@example.com',
    ],
);
```

response example```
[
    'name' => 'fred',
    'key' => 'fred',
    'emailAddress' => 'fred@example.com',
    'displayName' => 'Fred F. User',
    'active' => true,
    'timeZone' => 'Australia/Sydney',
    '_links' => [
        'jiraRest' => 'https://www.example.com/jira/rest/api/2/user?username=fred',
        'avatarUrls' => [
            '48x48' => 'https://www.example.com/jira/secure/useravatar?size=large&ownerId=fred',
            '24x24' => 'https://www.example.com/jira/secure/useravatar?size=small&ownerId=fred',
            '16x16' => 'https://www.example.com/jira/secure/useravatar?size=xsmall&ownerId=fred',
            '32x32' => 'https://www.example.com/jira/secure/useravatar?size=medium&ownerId=fred',
        ],
        'self' => 'https://www.example.com/jira/rest/api/2/user?username=fred',
    ],
];
```

---

### `Groups` Resource

[](#groups-resource)

#### `create` function

[](#create-function-1)

Create a group by given group parameter.

```
$client->groups()->create(
    body: [
        'name' => 'group name',
    ],
);
```

response example```
[
    'name' => 'jira-administrators',
    'self' => 'https://www.example.com/jira/rest/api/2/group?groupname=jira-administrators',
    'users' => [
        'size' => 1,
        'items' => [
            [
                'self' => 'https://www.example.com/jira/rest/api/2/user?username=fred',
                'name' => 'fred',
                'displayName' => 'Fred F. User',
                'active' => false,
            ],
        ],
        'max-results' => 50,
        'start-index' => 0,
        'end-index' => 0,
    ],
    'expand' => 'users',
];
```

---

#### `remove` function

[](#remove-function-1)

Delete a group by given group parameter.

```
$client->groups()->remove(
    query: [
        'name' => 'group name',
    ],
);
```

response example```
null
```

---

#### `getUsers` function

[](#getusers-function)

Return a paginated list of users who are members of the specified group and its subgroups.

```
$client->groups()->getUsers(
    query: [
        'groupname' => 'group name',
    ],
);
```

response example```
[
    'self' => 'https://example.com/rest/api/2/group/member?groupname=admin&startAt=2&maxResults=2',
    'nextPage' => 'https://example.com/rest/api/2/group/member?groupname=admin&startAt=4&maxResults=2',
    'maxResults' => 2,
    'startAt' => 3,
    'total' => 5,
    'isLast' => false,
    'values' => [
        [
            'self' => 'https://example/jira/rest/api/2/user?username=fred',
            'name' => 'Fred',
            'key' => 'fred',
            'emailAddress' => 'fred@atlassian.com',
            'avatarUrls' => [],
            'displayName' => 'Fred',
            'active' => true,
            'timeZone' => 'Australia/Sydney',
        ],
        [
            'self' => 'https://example/jira/rest/api/2/user?username=barney',
            'name' => 'Barney',
            'key' => 'barney',
            'emailAddress' => 'barney@atlassian.com',
            'avatarUrls' => [],
            'displayName' => 'Barney',
            'active' => false,
            'timeZone' => 'Australia/Sydney',
        ],
    ],
];
```

---

#### `addUser` function

[](#adduser-function)

Add given user to a group.

```
$client->groups()->addUser(
    query: [
        'groupname' => 'group name',
    ],
    body: [
        'name' => 'user name',
    ],
);
```

response example```
[
    'name' => 'example',
    'self' => 'url',
    'users' => [],
    'expand' => '',
];
```

---

#### `removeUser` function

[](#removeuser-function)

Remove given user from a group.

```
$client->groups()->removeUser(
    query: [
        'groupname' => 'group name',
        'username' => 'user name',
    ],
);
```

response example```
null
```

---

### `Issues` Resource

[](#issues-resource)

#### `create` function

[](#create-function-2)

Create an issue or a sub-task from a JSON representation.

```
$client
    ->issues()
    ->create(body: [...]);
```

response example```
[
    'id' => '10000',
    'key' => 'TST-24',
    'self' => 'https://www.example.com/jira/rest/api/2/issue/10000',
];
```

---

#### `bulk` function

[](#bulk-function)

Create issues or sub-tasks from a JSON representation.

```
$client
    ->issues()
    ->bulk(body: [
        [...],
        [...],
        [...]
    ]);
```

response example```
[
    'issues' => [
        [
            'id' => '10000',
            'key' => 'TST-24',
            'self' => 'https://www.example.com/jira/rest/api/2/issue/10000',
        ],
        [
            'id' => '10001',
            'key' => 'TST-25',
            'self' => 'https://www.example.com/jira/rest/api/2/issue/10001',
        ],
    ],
    'errors' => [],
];
```

---

#### `get` function

[](#get-function-1)

Return a full representation of the issue for the given issue key.

```
$client->issues()->get(id: 'KEY-1000', query: [...]);
```

response example```
[
    'expand' => 'renderedFields,names,schema,operations,editmeta,changelog,versionedRepresentations',
    'id' => '10002',
    'self' => 'https://www.example.com/jira/rest/api/2/issue/10002',
    'key' => 'EX-1',
    'fields' => [
        'watcher' => [
            'self' => 'https://www.example.com/jira/rest/api/2/issue/EX-1/watchers',
            'isWatching' => false,
            'watchCount' => 1,
            'watchers' => [
                [
                    'self' => 'https://www.example.com/jira/rest/api/2/user?username=fred',
                    'name' => 'fred',
                    'displayName' => 'Fred F. User',
                    'active' => false,
                ],
            ],
        ],
        'attachment' => [
            [
                'self' => 'https://www.example.com/jira/rest/api/2.0/attachments/10000',
                'filename' => 'picture.jpg',
                'author' => [
                    'self' => 'https://www.example.com/jira/rest/api/2/user?username=fred',
                    'name' => 'fred',
                    'avatarUrls' => [
                        '48x48' => 'https://www.example.com/jira/secure/useravatar?size=large&ownerId=fred',
                        '24x24' => 'https://www.example.com/jira/secure/useravatar?size=small&ownerId=fred',
                        '16x16' => 'https://www.example.com/jira/secure/useravatar?size=xsmall&ownerId=fred',
                        '32x32' => 'https://www.example.com/jira/secure/useravatar?size=medium&ownerId=fred',
                    ],
                    'displayName' => 'Fred F. User',
                    'active' => false,
                ],
                'created' => '2019-02-09T10:08:20.478+0000',
                'size' => 23123,
                'mimeType' => 'image/jpeg',
                'content' => 'https://www.example.com/jira/attachments/10000',
                'thumbnail' => 'https://www.example.com/jira/secure/thumbnail/10000',
            ],
        ],
        'sub-tasks' => [
            [
                'id' => '10000',
                'type' => [
                    'id' => '10000',
                    'name' => '',
                    'inward' => 'Parent',
                    'outward' => 'Sub-task',
                ],
                'outwardIssue' => [
                    'id' => '10003',
                    'key' => 'EX-2',
                    'self' => 'https://www.example.com/jira/rest/api/2/issue/EX-2',
                    'fields' => [
                        'status' => [
                            'iconUrl' => 'https://www.example.com/jira/images/icons/statuses/open.png',
                            'name' => 'Open',
                        ],
                    ],
                ],
            ],
        ],
        'description' => 'example bug report',
        'project' => [
            'self' => 'https://www.example.com/jira/rest/api/2/project/EX',
            'id' => '10000',
            'key' => 'EX',
            'name' => 'Example',
            'avatarUrls' => [
                '48x48' => 'https://www.example.com/jira/secure/projectavatar?size=large&pid=10000',
                '24x24' => 'https://www.example.com/jira/secure/projectavatar?size=small&pid=10000',
                '16x16' => 'https://www.example.com/jira/secure/projectavatar?size=xsmall&pid=10000',
                '32x32' => 'https://www.example.com/jira/secure/projectavatar?size=medium&pid=10000',
            ],
            'projectCategory' => [
                'self' => 'https://www.example.com/jira/rest/api/2/projectCategory/10000',
                'id' => '10000',
                'name' => 'FIRST',
                'description' => 'First Project Category',
            ],
        ],
        'comment' => [
            [
                'self' => 'https://www.example.com/jira/rest/api/2/issue/10010/comment/10000',
                'id' => '10000',
                'author' => [
                    'self' => 'https://www.example.com/jira/rest/api/2/user?username=fred',
                    'name' => 'fred',
                    'displayName' => 'Fred F. User',
                    'active' => false,
                ],
                'body' => 'Lorem ipsum dolor sit amet.',
                'updateAuthor' => [
                    'self' => 'https://www.example.com/jira/rest/api/2/user?username=fred',
                    'name' => 'fred',
                    'displayName' => 'Fred F. User',
                    'active' => false,
                ],
                'created' => '2019-02-09T10:08:20.180+0000',
                'updated' => '2019-02-09T10:08:20.181+0000',
                'visibility' => [
                    'type' => 'role',
                    'value' => 'Administrators',
                ],
            ],
        ],
        'issuelinks' => [
            [
                'id' => '10001',
                'type' => [
                    'id' => '10000',
                    'name' => 'Dependent',
                    'inward' => 'depends on',
                    'outward' => 'is depended by',
                ],
                'outwardIssue' => [
                    'id' => '10004L',
                    'key' => 'PRJ-2',
                    'self' => 'https://www.example.com/jira/rest/api/2/issue/PRJ-2',
                    'fields' => [
                        'status' => [
                            'iconUrl' => 'https://www.example.com/jira//images/icons/statuses/open.png',
                            'name' => 'Open',
                        ],
                    ],
                ],
            ],
            [
                'id' => '10002',
                'type' => [
                    'id' => '10000',
                    'name' => 'Dependent',
                    'inward' => 'depends on',
                    'outward' => 'is depended by',
                ],
                'inwardIssue' => [
                    'id' => '10004',
                    'key' => 'PRJ-3',
                    'self' => 'https://www.example.com/jira/rest/api/2/issue/PRJ-3',
                    'fields' => [
                        'status' => [
                            'iconUrl' => 'https://www.example.com/jira//images/icons/statuses/open.png',
                            'name' => 'Open',
                        ],
                    ],
                ],
            ],
        ],
        'worklog' => [
            [
                'self' => 'https://www.example.com/jira/rest/api/2/issue/10010/worklog/10000',
                'author' => [
                    'self' => 'https://www.example.com/jira/rest/api/2/user?username=fred',
                    'name' => 'fred',
                    'displayName' => 'Fred F. User',
                    'active' => false,
                ],
                'updateAuthor' => [
                    'self' => 'https://www.example.com/jira/rest/api/2/user?username=fred',
                    'name' => 'fred',
                    'displayName' => 'Fred F. User',
                    'active' => false,
                ],
                'comment' => 'I did some work here.',
                'updated' => '2019-02-09T10:08:20.486+0000',
                'visibility' => [
                    'type' => 'group',
                    'value' => 'jira-developers',
                ],
                'started' => '2019-02-09T10:08:20.486+0000',
                'timeSpent' => '3h 20m',
                'timeSpentSeconds' => 12000,
                'id' => '100028',
                'issueId' => '10002',
            ],
        ],
        'updated' => 1,
        'timetracking' => [
            'originalEstimate' => '10m',
            'remainingEstimate' => '3m',
            'timeSpent' => '6m',
            'originalEstimateSeconds' => 600,
            'remainingEstimateSeconds' => 200,
            'timeSpentSeconds' => 400,
        ],
    ],
    'names' => [
        'watcher' => 'watcher',
        'attachment' => 'attachment',
        'sub-tasks' => 'sub-tasks',
        'description' => 'description',
        'project' => 'project',
        'comment' => 'comment',
        'issuelinks' => 'issuelinks',
        'worklog' => 'worklog',
        'updated' => 'updated',
        'timetracking' => 'timetracking',
    ],
    'schema' => [],
];
```

---

#### `delete` function

[](#delete-function)

Delete an issue.

```
$client->issues()->delete(id: 'KEY-1000', query: [...]);
```

response example```
null
```

---

#### `edit` function

[](#edit-function)

Edit an issue from a JSON representation.

```
$client->issues()->edit(id: 'KEY-1000', body: [...], query: [...]);
```

response example```
null
```

---

#### `archive` function

[](#archive-function)

Archive an issue.

```
$client->issues()->archive(id: 'KEY-1000');
```

response example```
null
```

---

#### `assign` function

[](#assign-function)

Assign an issue to a user.

```
$client->issues()->assign(id: 'KEY-1000', body: [...]);
```

response example```
null
```

---

#### `getComments` function

[](#getcomments-function)

Return all comments for an issue.

```
$client->issues()->getComments(id: 'KEY-1000', query: [...]);
```

response example```
[
    'startAt' => 0,
    'maxResults' => 1,
    'total' => 1,
    'comments' => [
        [
            'self' => 'https://www.example.com/jira/rest/api/2/issue/10010/comment/10000',
            'id' => '10000',
            'author' => [
                'self' => 'https://www.example.com/jira/rest/api/2/user?username=fred',
                'name' => 'fred',
                'displayName' => 'Fred F. User',
                'active' => false,
            ],
            'body' => 'Lorem ipsum dolor sit amet.',
            'updateAuthor' => [
                'self' => 'https://www.example.com/jira/rest/api/2/user?username=fred',
                'name' => 'fred',
                'displayName' => 'Fred F. User',
                'active' => false,
            ],
            'created' => '2019-02-09T10:08:20.180+0000',
            'updated' => '2019-02-09T10:08:20.181+0000',
            'visibility' => [
                'type' => 'role',
                'value' => 'Administrators',
            ],
        ],
    ],
];
```

---

#### `addComment` function

[](#addcomment-function)

Add new comment to an issue.

```
$client->issues()->addComment(id: 'KEY-1000', body: [...], query: [...]);
```

response example```
[
    'self' => 'https://www.example.com/jira/rest/api/2/issue/10010/comment/10000',
    'id' => '10000',
    'author' => [
        'self' => 'https://www.example.com/jira/rest/api/2/user?username=fred',
        'name' => 'fred',
        'displayName' => 'Fred F. User',
        'active' => false,
    ],
    'body' => 'Lorem ipsum dolor sit amet.',
    'updateAuthor' => [
        'self' => 'https://www.example.com/jira/rest/api/2/user?username=fred',
        'name' => 'fred',
        'displayName' => 'Fred F. User',
        'active' => false,
    ],
    'created' => '2019-02-09T10:08:20.180+0000',
    'updated' => '2019-02-09T10:08:20.181+0000',
    'visibility' => [
        'type' => 'role',
        'value' => 'Administrators',
    ],
];
```

---

#### `updateComment` function

[](#updatecomment-function)

Update existing comment using its JSON representation.

```
$client->issues()->updateComment(id: 'KEY-1000', commentId: '10000', body: [...], query: [...]);
```

response example```
[
    'self' => 'https://www.example.com/jira/rest/api/2/issue/10010/comment/10000',
    'id' => '10000',
    'author' => [
        'self' => 'https://www.example.com/jira/rest/api/2/user?username=fred',
        'name' => 'fred',
        'displayName' => 'Fred F. User',
        'active' => false,
    ],
    'body' => 'Lorem ipsum dolor sit amet.',
    'updateAuthor' => [
        'self' => 'https://www.example.com/jira/rest/api/2/user?username=fred',
        'name' => 'fred',
        'displayName' => 'Fred F. User',
        'active' => false,
    ],
    'created' => '2019-02-09T10:08:20.180+0000',
    'updated' => '2019-02-09T10:08:20.181+0000',
    'visibility' => [
        'type' => 'role',
        'value' => 'Administrators',
    ],
];
```

---

#### `deleteComment` function

[](#deletecomment-function)

Delete an existing comment.

```
$client->issues()->deleteComment(id: 'KEY-1000', commentId: '10000', query: [...]);
```

response example```
null
```

---

#### `getComment` function

[](#getcomment-function)

Return a single comment.

```
$client->issues()->getComment(id: 'KEY-1000', commentId: '10000', query: [...]);
```

response example```
[
    'self' => 'https://www.example.com/jira/rest/api/2/issue/10010/comment/10000',
    'id' => '10000',
    'author' => [
        'self' => 'https://www.example.com/jira/rest/api/2/user?username=fred',
        'name' => 'fred',
        'displayName' => 'Fred F. User',
        'active' => false,
    ],
    'body' => 'Lorem ipsum dolor sit amet.',
    'updateAuthor' => [
        'self' => 'https://www.example.com/jira/rest/api/2/user?username=fred',
        'name' => 'fred',
        'displayName' => 'Fred F. User',
        'active' => false,
    ],
    'created' => '2019-02-09T10:08:20.180+0000',
    'updated' => '2019-02-09T10:08:20.181+0000',
    'visibility' => [
        'type' => 'role',
        'value' => 'Administrators',
    ],
];
```

---

#### `getTransitions` function

[](#gettransitions-function)

Get a list of the transitions possible for this issue by the current user, along with fields that are required and their types.

```
$client->issues()->getTransitions(id: 'KEY-1000', query: [...]);
```

response example```
[
    'expand' => 'transitions',
    'transitions' => [
        [
            'id' => '2',
            'name' => 'Close Issue',
            'to' => [
                'self' => 'https://localhost:8090/jira/rest/api/2.0/status/10000',
                'description' => 'The issue is currently being worked on.',
                'iconUrl' => 'https://localhost:8090/jira/images/icons/progress.gif',
                'name' => 'In Progress',
                'id' => '10000',
                'statusCategory' => [
                    'self' => 'https://localhost:8090/jira/rest/api/2.0/statuscategory/1',
                    'id' => 1,
                    'key' => 'in-flight',
                    'colorName' => 'yellow',
                    'name' => 'In Progress',
                ],
            ],
            'fields' => [
                'summary' => [
                    'required' => false,
                    'schema' => [
                        'type' => 'array',
                        'items' => 'option',
                        'custom' => 'com.atlassian.jira.plugin.system.customfieldtypes:multiselect',
                        'customId' => 10001,
                    ],
                    'name' => 'My Multi Select',
                    'hasDefaultValue' => false,
                    'operations' => ['set', 'add'],
                    'allowedValues' => ['red', 'blue'],
                ],
            ],
        ],
        [
            'id' => '711',
            'name' => 'QA Review',
            'to' => [
                'self' => 'https://localhost:8090/jira/rest/api/2.0/status/5',
                'description' => 'The issue is closed.',
                'iconUrl' => 'https://localhost:8090/jira/images/icons/closed.gif',
                'name' => 'Closed',
                'id' => '5',
                'statusCategory' => [
                    'self' => 'https://localhost:8090/jira/rest/api/2.0/statuscategory/9',
                    'id' => 9,
                    'key' => 'completed',
                    'colorName' => 'green',
                ],
            ],
            'fields' => [
                'summary' => [
                    'required' => false,
                    'schema' => [
                        'type' => 'array',
                        'items' => 'option',
                        'custom' => 'com.atlassian.jira.plugin.system.customfieldtypes:multiselect',
                        'customId' => 10001,
                    ],
                    'name' => 'My Multi Select',
                    'hasDefaultValue' => false,
                    'operations' => ['set', 'add'],
                    'allowedValues' => ['red', 'blue'],
                ],
                'colour' => [
                    'required' => false,
                    'schema' => [
                        'type' => 'array',
                        'items' => 'option',
                        'custom' => 'com.atlassian.jira.plugin.system.customfieldtypes:multiselect',
                        'customId' => 10001,
                    ],
                    'name' => 'My Multi Select',
                    'hasDefaultValue' => false,
                    'operations' => ['set', 'add'],
                    'allowedValues' => ['red', 'blue'],
                ],
            ],
        ],
    ],
];
```

---

#### `doTransition` function

[](#dotransition-function)

Perform a transition on an issue.

```
$client->issues()->doTransition(id: 'KEY-1000', body: [...], query: [...]);
```

response example```
null
```

---

#### `attach` function

[](#attach-function)

Add one or more attachments to an issue.

```
$client->issues()->attach(id: 'KEY-1000', body: [...]);
```

response example```
[
    [
        'self' => 'https://www.example.com/jira/rest/api/2.0/attachments/10000',
        'filename' => 'picture.jpg',
        'author' => [
            'self' => 'https://www.example.com/jira/rest/api/2/user?username=fred',
            'name' => 'fred',
            'avatarUrls' => [
                '48x48' => 'https://www.example.com/jira/secure/useravatar?size=large&ownerId=fred',
                '24x24' => 'https://www.example.com/jira/secure/useravatar?size=small&ownerId=fred',
                '16x16' => 'https://www.example.com/jira/secure/useravatar?size=xsmall&ownerId=fred',
                '32x32' => 'https://www.example.com/jira/secure/useravatar?size=medium&ownerId=fred',
            ],
            'displayName' => 'Fred F. User',
            'active' => false,
        ],
        'created' => '2019-02-09T10:08:20.478+0000',
        'size' => 23123,
        'mimeType' => 'image/jpeg',
        'content' => 'https://www.example.com/jira/attachments/10000',
        'thumbnail' => 'https://www.example.com/jira/secure/thumbnail/10000',
    ],
    [
        'self' => 'https://www.example.com/jira/rest/api/2.0/attachments/10001',
        'filename' => 'dbeuglog.txt',
        'author' => [
            'self' => 'https://www.example.com/jira/rest/api/2/user?username=fred',
            'name' => 'fred',
            'avatarUrls' => [
                '48x48' => 'https://www.example.com/jira/secure/useravatar?size=large&ownerId=fred',
                '24x24' => 'https://www.example.com/jira/secure/useravatar?size=small&ownerId=fred',
                '16x16' => 'https://www.example.com/jira/secure/useravatar?size=xsmall&ownerId=fred',
                '32x32' => 'https://www.example.com/jira/secure/useravatar?size=medium&ownerId=fred',
            ],
            'displayName' => 'Fred F. User',
            'active' => false,
        ],
        'created' => '2019-02-09T10:08:20.478+0000',
        'size' => 2460,
        'mimeType' => 'text/plain',
        'content' => 'https://www.example.com/jira/attachments/10001',
        'thumbnail' => 'https://www.example.com/jira/secure/thumbnail/10002',
    ],
];
```

---

#### `search` function

[](#search-function)

Search for issues using JQL.

```
$client->issues()->search(query: [...]);
```

response example```
[
    'expand' => 'names,schema',
    'startAt' => 0,
    'maxResults' => 50,
    'total' => 1,
    'issues' => [
        [
            'expand' => '',
            'id' => '10001',
            'self' => 'https://www.example.com/jira/rest/api/2/issue/10001',
            'key' => 'HSP-1',
        ],
    ],
];
```

---

### `Requests` Resource

[](#requests-resource)

#### `create` function

[](#create-function-3)

Create a customer request in a service project.

```
$client->requests()->create(body: [...]);
```

response example```
[
    '_expands' => ['participant', 'status', 'sla', 'requestType', 'serviceDesk'],
    'issueId' => '107001',
    'issueKey' => 'HELPDESK-1',
    'requestTypeId' => '25',
    'serviceDeskId' => '10',
    'createdDate' => [
        'iso8601' => '2015-10-08T14:42:00+0700',
        'jira' => '2015-10-08T14:42:00.000+0700',
        'friendly' => 'Monday 14:42 PM',
        'epochMillis' => 1444290120000,
    ],
    'reporter' => [
        'name' => 'fred',
        'key' => 'fred',
        'emailAddress' => 'fred@example.com',
        'displayName' => 'Fred F. User',
        'active' => true,
        'timeZone' => 'Australia/Sydney',
        '_links' => [
            'jiraRest' => 'https://www.example.com/jira/rest/api/2/user?username=fred',
            'avatarUrls' => [
                '48x48' => 'https://www.example.com/jira/secure/useravatar?size=large&ownerId=fred',
                '24x24' => 'https://www.example.com/jira/secure/useravatar?size=small&ownerId=fred',
                '16x16' => 'https://www.example.com/jira/secure/useravatar?size=xsmall&ownerId=fred',
                '32x32' => 'https://www.example.com/jira/secure/useravatar?size=medium&ownerId=fred',
            ],
            'self' => 'https://www.example.com/jira/rest/api/2/user?username=fred',
        ],
    ],
    'requestFieldValues' => [
        [
            'fieldId' => 'summary',
            'label' => 'What do you need?',
            'value' => 'Request JSD help via REST',
        ],
        [
            'fieldId' => 'description',
            'label' => 'Why do you need this?',
            'value' => 'I need a new mouse for my Mac',
        ],
    ],
    'currentStatus' => [
        'status' => 'Waiting for Support',
        'statusDate' => [
            'iso8601' => '2015-10-08T14:01:00+0700',
            'jira' => '2015-10-08T14:01:00.000+0700',
            'friendly' => 'Today 14:01 PM',
            'epochMillis' => 1444287660000,
        ],
    ],
    '_links' => [
        'jiraRest' => 'https://host:port/context/rest/api/2/issue/107001',
        'web' => 'https://host:port/context/servicedesk/customer/portal/10/HELPDESK-1',
        'self' => 'https://host:port/context/rest/servicedeskapi/request/107001',
    ],
];
```

---

### `Users` Resource

[](#users-resource)

#### `update` function

[](#update-function)

Modify user.

```
$client->users()->update(body: [...]);
```

response example```
[
    'self' => 'https://www.example.com/jira/rest/api/2/user/charlie',
    'key' => 'charlie',
    'name' => 'charlie',
    'emailAddress' => 'charlie@atlassian.com',
    'displayName' => 'Charlie of Atlassian',
];
```

---

#### `create` function

[](#create-function-4)

Create user.

```
$client->users()->create(body: [...]);
```

response example```
[
    'self' => 'https://www.example.com/jira/rest/api/2/user/charlie',
    'key' => 'charlie',
    'name' => 'charlie',
    'emailAddress' => 'charlie@atlassian.com',
    'displayName' => 'Charlie of Atlassian',
];
```

---

#### `remove` function

[](#remove-function-2)

Remove user and its references (like project roles associations, watches, history).

```
$client->users()->remove(query: [...]);
```

response example```
null
```

---

#### `get` function

[](#get-function-2)

Return a user.

```
$client->users()->get(query: [...]);
```

response example```
[
    'self' => 'https://www.example.com/jira/rest/api/2/user?username=fred',
    'name' => 'fred',
    'emailAddress' => 'fred@example.com',
    'avatarUrls' => [
        '48x48' => 'https://www.example.com/jira/secure/useravatar?size=large&ownerId=fred',
        '24x24' => 'https://www.example.com/jira/secure/useravatar?size=small&ownerId=fred',
        '16x16' => 'https://www.example.com/jira/secure/useravatar?size=xsmall&ownerId=fred',
        '32x32' => 'https://www.example.com/jira/secure/useravatar?size=medium&ownerId=fred',
    ],
    'displayName' => 'Fred F. User',
    'active' => true,
    'timeZone' => 'Australia/Sydney',
    'groups' => [
        'size' => 3,
        'items' => [
            [
                'name' => 'jira-user',
                'self' => 'https://www.example.com/jira/rest/api/2/group?groupname=jira-user',
            ],
            [
                'name' => 'jira-admin',
                'self' => 'https://www.example.com/jira/rest/api/2/group?groupname=jira-admin',
            ],
            [
                'name' => 'important',
                'self' => 'https://www.example.com/jira/rest/api/2/group?groupname=important',
            ],
        ],
    ],
    'applicationRoles' => [
        'size' => 1,
        'items' => [],
    ],
    'expand' => 'groups,applicationRoles',
];
```

Contributing
------------

[](#contributing)

Thank you for considering contributing to the Jira PHP! The contribution guide can be found in the [CONTRIBUTING](CONTRIBUTING.md).

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

If you discover any security-related issues, please email  instead of using the issue tracker.

License
-------

[](#license)

Jira PHP is an open-sourced software licensed under the **[MIT license](https://opensource.org/licenses/MIT)**.

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity3

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 92.8% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

2

Last Release

799d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/955cdd3d991a7262d20e0526bf87e07f040eb5ea81b6df6b16ddb502574d6a3f?d=identicon)[mi-lopez](/maintainers/mi-lopez)

---

Top Contributors

[![devmoath](https://avatars.githubusercontent.com/u/28797003?v=4)](https://github.com/devmoath "devmoath (64 commits)")[![mi-lopez](https://avatars.githubusercontent.com/u/15022191?v=4)](https://github.com/mi-lopez "mi-lopez (3 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (2 commits)")

---

Tags

phpapiclientsdkjiraservice-desk

###  Code Quality

TestsPest

Static AnalysisPHPStan, Rector

Code StyleLaravel Pint

Type Coverage Yes

### Embed Badge

![Health badge](/badges/mi-lopez-jira-php/health.svg)

```
[![Health](https://phpackages.com/badges/mi-lopez-jira-php/health.svg)](https://phpackages.com/packages/mi-lopez-jira-php)
```

###  Alternatives

[openai-php/laravel

OpenAI PHP for Laravel is a supercharged PHP API client that allows you to interact with the Open AI API

3.7k7.6M74](/packages/openai-php-laravel)[kunalvarma05/dropbox-php-sdk

Dropbox PHP API V2 SDK (Unofficial)

3633.0M18](/packages/kunalvarma05-dropbox-php-sdk)[resend/resend-php

Resend PHP library.

564.7M21](/packages/resend-resend-php)[mozex/anthropic-laravel

Anthropic PHP for Laravel is a supercharged PHP API client that allows you to interact with the Anthropic API

71226.4k1](/packages/mozex-anthropic-laravel)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
