PHPackages                             shockraver/php-jira-rest-client - 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. [HTTP &amp; Networking](/categories/http)
4. /
5. shockraver/php-jira-rest-client

ActiveLibrary[HTTP &amp; Networking](/categories/http)

shockraver/php-jira-rest-client
===============================

JIRA REST API Client for PHP Users.

5.5.1(2y ago)06Apache-2.0PHPPHP ^8.0

Since Feb 3Pushed 2y agoCompare

[ Source](https://github.com/ShockRaver/php-jira-rest-client)[ Packagist](https://packagist.org/packages/shockraver/php-jira-rest-client)[ RSS](/packages/shockraver-php-jira-rest-client/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (6)Versions (166)Used By (0)

PHP JIRA Rest Client
====================

[](#php-jira-rest-client)

[![Latest Stable Version](https://camo.githubusercontent.com/a021286bb2f9e3e4b215ff7dbe1e76b5dd317d55812e866ddd99e5db41af73ec/68747470733a2f2f706f7365722e707567782e6f72672f6c6573737469662f7068702d6a6972612d726573742d636c69656e742f762f737461626c65)](https://packagist.org/packages/lesstif/php-jira-rest-client)[![Latest Unstable Version](https://camo.githubusercontent.com/b29dc668f71deb850f5a9eaff0b6f1e32d9f7a0c33fefdb857868569ba473b7b/68747470733a2f2f706f7365722e707567782e6f72672f6c6573737469662f7068702d6a6972612d726573742d636c69656e742f762f756e737461626c65)](https://packagist.org/packages/lesstif/php-jira-rest-client)[![Build Status](https://camo.githubusercontent.com/3a855d9dbce0f56fcdd483a951fd2edef94734f80180dc6988c25ae3fab94915/68747470733a2f2f7472617669732d63692e6f72672f6c6573737469662f7068702d6a6972612d726573742d636c69656e742e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/lesstif/php-jira-rest-client)[![StyleCI](https://camo.githubusercontent.com/1893bb3b85bebb54818daadcf8ddfd80be4c686c4158a85a3639bd5e14fb831c/68747470733a2f2f7374796c6563692e696f2f7265706f732f33303031353336392f736869656c643f6272616e63683d6d61696e267374796c653d666c6174)](https://styleci.io/repos/30015369)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/62cda9e2ea3224ee7011ff64d3133f0f9b40e989e1c37f234ff8e5bb81126a3a/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6c6573737469662f7068702d6a6972612d726573742d636c69656e742f6261646765732f7175616c6974792d73636f72652e706e673f623d6d61696e)](https://scrutinizer-ci.com/g/lesstif/php-jira-rest-client/?branch=main)[![Coverage Status](https://camo.githubusercontent.com/c68d813c486917056d6c7958bea2b5babc59e77f4ef54a6f6aa32fc174835037/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f6c6573737469662f7068702d6a6972612d726573742d636c69656e742f62616467652e737667)](https://coveralls.io/github/lesstif/php-jira-rest-client)[![License](https://camo.githubusercontent.com/7fd04e054fd60e2bebe426ef17fcd54ee0f5b1c034fa953814d963827731f1f0/68747470733a2f2f706f7365722e707567782e6f72672f6c6573737469662f7068702d6a6972612d726573742d636c69656e742f6c6963656e7365)](https://packagist.org/packages/lesstif/php-jira-rest-client)[![Total Downloads](https://camo.githubusercontent.com/5c12fa9eb0f4f2ee3d6170ae0e0e2eba2fde0db52fde9d4fad9a481ed38ccf09/68747470733a2f2f706f7365722e707567782e6f72672f6c6573737469662f7068702d6a6972612d726573742d636c69656e742f646f776e6c6f616473)](https://packagist.org/packages/lesstif/php-jira-rest-client)[![Monthly Downloads](https://camo.githubusercontent.com/fe11a924a898eef4eeca47577c6084e9be6481a7bceafb0e8dfba6902b9804f9/68747470733a2f2f706f7365722e707567782e6f72672f6c6573737469662f7068702d6a6972612d726573742d636c69656e742f642f6d6f6e74686c79)](https://packagist.org/packages/lesstif/php-jira-rest-client)[![Daily Downloads](https://camo.githubusercontent.com/999a902a8c369a9789681b5814f64ae9f70981483e7ecab7e6434e0d787c8cf5/68747470733a2f2f706f7365722e707567782e6f72672f6c6573737469662f7068702d6a6972612d726573742d636c69656e742f642f6461696c79)](https://packagist.org/packages/lesstif/php-jira-rest-client)

On-Premise only
===============

[](#on-premise-only)

If you want to interact with Jira cloud instead of On-Premise(Server, Data Center), [check out this repository](https://github.com/lesstif/php-JiraCloud-RESTAPI).

From version &gt;= 5.0.0 of this repository this project is only using V2 of the Jira rest API, to use V3 [check out this repository](https://github.com/lesstif/php-JiraCloud-RESTAPI).

Requirements
============

[](#requirements)

- PHP &gt;= 8.0
- [php JsonMapper](https://github.com/netresearch/jsonmapper)
- [phpdotenv](https://github.com/vlucas/phpdotenv)

Installation
============

[](#installation)

1. Download and Install PHP Composer.

    ```
    curl -sS https://getcomposer.org/installer | php
    ```
2. Next, run the Composer command to install the latest version of php jira rest client.

    ```
    php composer.phar require lesstif/php-jira-rest-client
    ```

    or add the following to your composer.json file.

    ```
    {
        "require": {
            "lesstif/php-jira-rest-client": "^5.0"
        }
    }
    ```
3. Then run Composer's install or update commands to complete installation.

    ```
    php composer.phar install
    ```
4. After installing, you need to require Composer's autoloader:

    ```
    require 'vendor/autoload.php';
    ```

**Laravel:** Once installed, if you are not using automatic package discovery, then you need to register the `JiraRestApi\JiraRestApiServiceProvider` service provider in your `config/app.php`.

Configuration
=============

[](#configuration)

you can choose loads environment variables either 'dotenv' or 'array'.

use dotenv
----------

[](#use-dotenv)

If you want to use Dotenv based configuration,first of all, you have to install dependency.

```
composer require vlucas/phpdotenv
```

then copy .env.example file to .env on your project root.

```
JIRA_HOST='https://your-jira.host.com'
JIRA_USER='jira-username'
JIRA_PASS='jira-password-OR-api-token'
# if TOKEN_BASED_AUTH set to true, ignore JIRA_USER and JIRA_PASS.
TOKEN_BASED_AUTH=true
PERSONAL_ACCESS_TOKEN='your-access-token-here'
# to enable session cookie authorization
# COOKIE_AUTH_ENABLED=true
# COOKIE_FILE=storage/jira-cookie.txt
# if you are behind a proxy, add proxy settings
PROXY_SERVER='your-proxy-server'
PROXY_PORT='proxy-port'
PROXY_USER='proxy-username'
PROXY_PASSWORD='proxy-password'
```

**Important Note:**As of March 15, 2018, in accordance to the [Atlassian REST API Policy](https://developer.atlassian.com/platform/marketplace/atlassian-rest-api-policy/), Basic auth with password to be deprecated. Instead of password, you should using [API token](https://confluence.atlassian.com/cloud/api-tokens-938839638.html).

**Laravel Users:**If you are developing with laravel framework(5.x), you must append above configuration to your application .env file.

use array
---------

[](#use-array)

create Service class with ArrayConfiguration parameter.

```
use JiraRestApi\Configuration\ArrayConfiguration;
use JiraRestApi\Issue\IssueService;

$iss = new IssueService(new ArrayConfiguration(
          [
               'jiraHost' => 'https://your-jira.host.com',
                // Basic authentication deprecated
                /*
                 'jiraUser' => 'jira-username',
                'jiraPassword' => 'jira-password-OR-api-token',
                */
               // instead,you can use the token based authentication.
               'useTokenBasedAuth' => true,
               'personalAccessToken' => 'your-token-here',

                // custom log config
               'jiraLogEnabled' => true,
               'jiraLogFile' => "my-jira-rest-client.log",
               'jiraLogLevel' => 'INFO',

               // to enable session cookie authorization (with basic authorization only)
               'cookieAuthEnabled' => true,
               'cookieFile' => storage_path('jira-cookie.txt'),
               // if you are behind a proxy, add proxy settings
               'proxyServer' => 'your-proxy-server',
               'proxyPort' => 'proxy-port',
               'proxyUser' => 'proxy-username',
               'proxyPassword' => 'proxy-password',
          ]
   ));
```

Usage
=====

[](#usage)

Table of Contents
-----------------

[](#table-of-contents)

### Project

[](#project)

- [Create Project](#create-project)
- [Update Project](#update-project)
- [Delete Project](#delete-project)
- [Get Project Info](#get-project-info)
- [Get All Project list](#get-all-project-list)
- [Get Project Components](#get-project-components)
- [Get Project Type](#get-project-type)
- [Get Project Version](#get-project-version)

### Custom Field

[](#custom-field)

- [Get All Field list](#get-all-field-list)
- [Create Custom Field](#create-custom-field)

### Issue

[](#issue)

- [Get Issue Info](#get-issue-info)
- [Create Issue](#create-issue)
- [Create Issue - bulk](#create-multiple-issues)
- [Create Sub Task](#create-sub-task)
- [Add Attachment](#add-attachment)
- [Update issue](#update-issue)
    - [Update Labels](#update-labels)
    - [Update Fix Versions](#update-fix-versions)
- [Change assignee](#change-assignee)
- [Remove issue](#remove-issue)
- [Perform a transition on an issue](#perform-a-transition-on-an-issue)
- [Perform an advanced search, using the JQL](#perform-an-advanced-search)
    - [Simple JQL](#simple-query)
    - [Simple Query with LinkedIssue](#simple-query-with-linkedissue)
    - [JQL With pagination](#jql-with-pagination)
    - [Using JQL Query class](#jql-query-class)
- [Remote Issue Link](#remote-issue-link)
    - [Get Remote Issue Link](#get-remote-issue-link)
    - [Create Remote Issue Link](#create-remote-issue-link)
- [Issue time tracking](#issue-time-tracking)
- [Add worklog in Issue](#add-worklog-in-issue)
- [Edit worklog in Issue](#edit-worklog-in-issue)
- [Get Issue worklog](#get-issue-worklog)
- [Add watcher to Issue](#add-watcher-to-issue)
- [Remove watcher from Issue](#remove-watcher-from-issue)
- [Send a notification to the recipients](#issue-notify)
- [Read property](#read-property)
- [Write property](#write-propert)

### Comment

[](#comment)

- [Add comment](#add-comment)
- [Get comment](#get-comment)
- [Delete comment](#delete-comment)
- [Update comment](#update-comment)

### IssueLink

[](#issuelink)

- [Create Issue Link](#create-issue-link)
- [Get Issue LinkType](#get-issue-linktype)

### User

[](#user)

- [Create User](#create-user)
- [Get User Info](#get-user-info)
- [Find Users](#find-users)
- [Find Assignable Users](#find-assignable-users)
- [Find Users by query](#find-users-by-query)
- [Delete User](#delete-user)
- [Update User](#update-user)

### Group

[](#group)

- [Create Group](#create-group)
- [Get Users from group](#get-users-from-group)
- [Add User to group](#add-user-to-group)
- [Remove User from group](#remove-user-from-group)

### Priority

[](#priority)

- [Get All Priority list](#get-all-priority-list)
- [Get Priority](#get-priority)

### Attachment

[](#attachment)

- [Get attachment Info](#get-attachment-info)
- [Remove attachment](#remove-attachment)

### Version

[](#version)

- [Create version](#create-version)
- [Update version](#update-version)
- [Delete version](#delete-version)
- [Get version related issues](#get-version-related-issues)
- [Get version unresolved issues](#get-version-related-issues)

### Component

[](#component)

- [Create component](#create-component)
- [Update component](#update-component)
- [Delete component](#delete-component)

### Board

[](#board)

- [Get board list](#get-board-list)
- [Get board info](#get-board-info)
- [Get board issues](#get-board-issues)
- [Get board epics](#get-board-epics)

### Epic

[](#epic)

- [Get epic info](#)

#### Create Project

[](#create-project)

Create a new project.

[See Jira API reference](https://docs.atlassian.com/software/jira/docs/api/REST/latest/#api/2/project-createProject)

```
