PHPackages                             madmis/jira-api - 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. madmis/jira-api

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

madmis/jira-api
===============

Jira REST API php client

1.2.7(9y ago)67502MITPHPPHP &gt;=5.5.0

Since Aug 28Pushed 9y ago1 watchersCompare

[ Source](https://github.com/madmis/jira-api)[ Packagist](https://packagist.org/packages/madmis/jira-api)[ RSS](/packages/madmis-jira-api/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (8)Versions (13)Used By (0)

JIRA REST API PHP Client
========================

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

[![SensioLabsInsight](https://camo.githubusercontent.com/f7335fa58e876b64a0698dc326f9f6ff329a0d9204875b35f3bb38290a5cdd06/68747470733a2f2f696e73696768742e73656e73696f6c6162732e636f6d2f70726f6a656374732f37333332626265302d376563662d343232382d616664622d6535393963363063396161302f6d696e692e706e67)](https://insight.sensiolabs.com/projects/7332bbe0-7ecf-4228-afdb-e599c60c9aa0)[![Build Status](https://camo.githubusercontent.com/8227f25ddc39a960e04b6298ae9b23d8b6e6e3ba5269ce8480bde7c8775b18ee/68747470733a2f2f7472617669732d63692e6f72672f6d61646d69732f6a6972612d6170692e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/madmis/jira-api)[![Coverage Status](https://camo.githubusercontent.com/7e096add854b52bfac5b18c5e9656f6c550941e5a0b23a8ebe3cfcc90b3e9ecb/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f6d61646d69732f6a6972612d6170692f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/github/madmis/jira-api?branch=master)[![Latest Stable Version](https://camo.githubusercontent.com/a9da73aaecf96b76a6d6bb979cf216f3556c8d8b25300d6b3a4e988b6685bf2f/68747470733a2f2f706f7365722e707567782e6f72672f6d61646d69732f6a6972612d6170692f762f737461626c65)](https://packagist.org/packages/madmis/jira-api)[![Total Downloads](https://camo.githubusercontent.com/96b5ccdf5af3476c51130cfd0943661617f6d1ef74c3d0e63ef21d5ae1500957/68747470733a2f2f706f7365722e707567782e6f72672f6d61646d69732f6a6972612d6170692f646f776e6c6f616473)](https://packagist.org/packages/madmis/jira-api)[![License](https://camo.githubusercontent.com/3e8278811b1210d9b8a2f9c14fb56ba5bd315894c5be2feeea893ef4bc432754/68747470733a2f2f706f7365722e707567782e6f72672f6d61646d69732f6a6972612d6170692f6c6963656e7365)](https://packagist.org/packages/madmis/jira-api)

JIRA provides REST APIs that you can use to interact with JIRA programmatically. This API client will help you interact with JIRA by REST API.

License
=======

[](#license)

MIT License

JIRA REST API Reference
=======================

[](#jira-rest-api-reference)

Contributing
============

[](#contributing)

To create new endpoint - [create issue](https://github.com/madmis/jira-api/issues/new) or [create pull request](https://github.com/madmis/jira-api/compare)

Install
=======

[](#install)

```
composer require madmis/jira-api 1.0.*

```

Usage
=====

[](#usage)

```
$api = new madmis\JiraApi\JiraApi('http://localhost:8080/', '/rest/api/2');

$auth = new madmis\JiraApi\Authentication\Basic('email@test.com', 'password');
$api->setAuthentication($auth);

$projectList = $api->project()->getProjects();

$project = $api->project()->getProject('MFTP');

$issue = $api->issue()->getIssue('MFTP-4');

// Issue result
array [
  'expand' => "renderedFields,names,schema,transitions,operations,editmeta,changelog"
  'id' => "10003"
  'self' => "http://localhost:8080/rest/api/2/issue/10003"
  'key' => "MFTP-4"
  'fields' => { ... }
]
```

\###Create Issue

```
$api = new madmis\JiraApi\JiraApi('http://localhost:8080/', '/rest/api/2');

$auth = new madmis\JiraApi\Authentication\Basic('email@test.com', 'password');
$api->setAuthentication($auth);

// without mapping
$result = $api->issue()->createIssue('PROJ', 'summary', 1, ['description' => 'description']);

// Issue result
array [
  'id' => "10105"
  'key' => "PROJ-9"
  'self' => "http://127.0.0.1:8080/rest/api/2/issue/10105"
]

// with mapping
$result = $api->issue()->createIssue('PROJ', 'summary', 1, ['description' => 'description'], true);

// Issue result
class madmis\JiraApi\Model\Issue {
  protected $self => "http://127.0.0.1:8080/rest/api/2/issue/10104"
  protected $id => 10104
  protected $key => "PROJ-8"
  protected $labels => []
  protected $description => NULL
  protected $summary => NULL
  protected $updated => NULL
  protected $created => NULL
  protected $issueType => NULL
  protected $project => NULL
  protected $creator => NULL
  protected $reporter => NULL
  protected $assignee => NULL
  protected $status => NULL
}
```

\###Tempo worklog (Tempo timesheets)

```
// This is default options, it is not required to set them.
// Set them only it Tempo REST API has another urn
$options = [
    'tempo_timesheets_urn' => '/rest/tempo-timesheets/3',
];
$api = new madmis\JiraApi\JiraApi('http://localhost:8080/', '/rest/api/2', $options);

$auth = new madmis\JiraApi\Authentication\Basic('email@test.com', 'password');
$api->setAuthentication($auth);

$issue = $api->issue()->getIssue('MFTP-4');

// Tempo worklog result
array [
  array [
    'timeSpentSeconds' => 28800
    'dateStarted' => "2015-08-29T00:00:00.000"
    'comment' => "2323"
    'self' => "http://127.0.0.1:8080/rest/tempo-timesheets/3/worklogs/10000"
    'id' => 10000
    'author' => [ ... ]
    'issue' => [ ... ]
    'worklogAttributes' => [ ... ]
  ]
]
```

\###Mapping

```
$issue = $api->issue()->getIssue('MFTP-4', '*all', '', true);

// Result
class madmis\JiraApi\Model\Issue {
    protected $self => "http://localhost:8080/rest/api/2/issue/10003"
    protected $id => 10003
    protected $key => "MFTP-4"
    protected $updated => class DateTime
    protected $issueType => class madmis\JiraApi\Model\IssueType
    protected $project => class madmis\JiraApi\Model\Project
    protected $creator => class madmis\JiraApi\Model\User
    protected $reporter => class madmis\JiraApi\Model\User
    protected $assignee => class madmis\JiraApi\Model\User
    protected $status => class madmis\JiraApi\Model\IssueStatus
  }
```

\###Error handling Each client request errors wrapped to custom exception **madmis\\JiraApi\\Exception\\ClientException**

```
class madmis\JiraApi\Exception\ClientException {
  private $request => class GuzzleHttp\Psr7\Request
  private $response => NULL
  protected $message => "cURL error 7: Failed to connect to 127.0.0.1 port 8080: Connection refused (see http://curl.haxx.se/libcurl/c/libcurl-errors.html)"
  ...
}
```

**ClientException** contains original **request object** and **response object** if response available

```
class madmis\JiraApi\Exception\ClientException {
  private $request => class GuzzleHttp\Psr7\Request
  private $response => class GuzzleHttp\Psr7\Response {
    private $reasonPhrase => "Unauthorized"
    private $statusCode => 401
    ...
  }
  protected $message => "Client error: 401"
  ...
}
```

So, to handle errors use try/catch

```
try {
    $issue = $api->issue()->getIssue('MFTP-4');
} catch (madmis\JiraApi\Exception\ClientException $ex) {
    // any actions (log error, send email, ...)
}
```

Running the tests
=================

[](#running-the-tests)

To run the tests, you'll need to install [phpunit](https://phpunit.de/) and [behat](https://github.com/Behat/Behat). Easiest way to do this is through composer.

```
composer install

```

### Running Unit tests

[](#running-unit-tests)

```
php vendor/bin/phpunit -c phpunit.xml.dist

```

### Running Behat tests

[](#running-behat-tests)

To run Behat test you'll need to install [Jira](https://www.atlassian.com/software/jira/download). Create config file from example `behat.yml.dist`

```
php vendor/bin/behat -c behat.yml

```

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity22

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity65

Established project with proven stability

 Bus Factor1

Top contributor holds 100% 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 ~41 days

Total

12

Last Release

3458d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1774703?v=4)[Dmytro](/maintainers/madmis)[@madmis](https://github.com/madmis)

---

Top Contributors

[![madmis](https://avatars.githubusercontent.com/u/1774703?v=4)](https://github.com/madmis "madmis (1 commits)")

---

Tags

jira-apiapirestjira

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/madmis-jira-api/health.svg)

```
[![Health](https://phpackages.com/badges/madmis-jira-api/health.svg)](https://phpackages.com/packages/madmis-jira-api)
```

###  Alternatives

[onesignal/onesignal-php-api

A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com

34170.2k2](/packages/onesignal-onesignal-php-api)[ory/hydra-client

Documentation for all of Ory Hydra's APIs.

17435.9k](/packages/ory-hydra-client)[zenditplatform/zendit-php-sdk

PHP client for Zendit API

1204.3k](/packages/zenditplatform-zendit-php-sdk)[huaweicloud/huaweicloud-sdk-php

Huawei Cloud SDK for PHP

1829.2k2](/packages/huaweicloud-huaweicloud-sdk-php)[ory/hydra-client-php

Documentation for all of Ory Hydra's APIs.

1710.8k](/packages/ory-hydra-client-php)

PHPackages © 2026

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