PHPackages                             fr3nch13/cakephp-jira - 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. fr3nch13/cakephp-jira

ActiveCakephp-plugin[API Development](/categories/api)

fr3nch13/cakephp-jira
=====================

A CakePHP 4.x Plugin to intereact with Jira.

2.4.3(3y ago)32.8k[1 PRs](https://github.com/fr3nch13/cakephp-jira/pulls)MITPHPPHP ~7.4|~8.0

Since Nov 12Pushed 1y ago2 watchersCompare

[ Source](https://github.com/fr3nch13/cakephp-jira)[ Packagist](https://packagist.org/packages/fr3nch13/cakephp-jira)[ Docs](https://github.com/fr3nch13/cakephp-jira)[ RSS](/packages/fr3nch13-cakephp-jira/feed)WikiDiscussions master Synced today

READMEChangelog (10)Dependencies (4)Versions (32)Used By (0)

CakePHP Jira Plugin
===================

[](#cakephp-jira-plugin)

[![Build Status](https://camo.githubusercontent.com/f5f8c468aac5f6b106f3b9eb3461a5f3031438b2a2e80632c86ed719614627b8/68747470733a2f2f7472617669732d63692e636f6d2f6672336e636831332f63616b657068702d6a6972612e7376673f6272616e63683d6d6173746572)](https://travis-ci.com/fr3nch13/cakephp-jira)[![Total Downloads](https://camo.githubusercontent.com/e29f74f3fe233a3e81fe524208c55e69c88c298b2935e995a4484fbd51262f1b/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6672336e636831332f63616b657068702d6a6972612e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/fr3nch13/cakephp-jira)[![Latest Stable Version](https://camo.githubusercontent.com/b53b2605fa5e422b487fd0312aae86baa509df4484e3e036abb1f65c57aad555/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6672336e636831332f63616b657068702d6a6972612e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/fr3nch13/cakephp-jira)[![Coverage Status](https://camo.githubusercontent.com/484a7e6ed61062eee6e2977cc4dc5e9b9df0e336be0d6a95052157ef3152f4e7/68747470733a2f2f696d672e736869656c64732e696f2f636f6465636f762f632f6769746875622f6672336e636831332f63616b657068702d6a6972612e7376673f7374796c653d666c61742d737175617265)](https://codecov.io/github/fr3nch13/cakephp-jira)

[![Build Status](https://camo.githubusercontent.com/fa6e93552277595ae9dd5044918f8b28af46ac45ced3fb3bebe92d30fa77913c/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6672336e636831332f63616b657068702d6a6972612f6261646765732f6275696c642e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/fr3nch13/cakephp-jira/build-status/master)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/43a448eaf6693fc2a62ea47f2b68aae3ac9d816ef58618246ee5b658c38d3b73/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6672336e636831332f63616b657068702d6a6972612f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/fr3nch13/cakephp-jira/?branch=master)[![Code Coverage](https://camo.githubusercontent.com/d1ac4689549f6ac9353e51e045d4ec586258c64b02eb74d7bd6d7b86e5496a49/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6672336e636831332f63616b657068702d6a6972612f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/fr3nch13/cakephp-jira/?branch=master)[![Code Intelligence Status](https://camo.githubusercontent.com/9719065286e6ae61844b6c944283cb0d2ce7d25f920fbf0f912ff3e877e38907/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6672336e636831332f63616b657068702d6a6972612f6261646765732f636f64652d696e74656c6c6967656e63652e7376673f623d6d6173746572)](https://scrutinizer-ci.com/code-intelligence)

This is a CakePHP 4.x plugin to interact with your Jira Server.

This makes heavy use of [lesstif/php-jira-rest-client's](https://github.com/lesstif/php-jira-rest-client) project as essentially a CakePHP specific wrapper around that project.

Installation
------------

[](#installation)

You can install this plugin into your CakePHP application using [composer](http://getcomposer.org).

Either run the following command (may vary on how you have composer installed):

```
composer require fr3nch13/cakephp-jira

```

Or add the below to your composer.json file:

```
{
    "require": {
        "fr3nch13/cakephp-jira": "^2.0"
    }
}

```

Then run:

```
composer update

```

Setup
-----

[](#setup)

In your `src/Application.php's bootstrap()` method, add the following:

```
/**
 * Bootstrap function for browser-based access.
 *
 * @return void
 */
public function bootstrap()
{
    /**
     * Load stuff needed from the cakephp core.
     */
    parent::bootstrap();

    // .... other code here.

    /**
     * Load all of the plugins you need.
     */
    $this->addPlugin('Fr3nch13/Jira');

    // .... other code here.
}
```

Load the helper in your `src/View/AppView.php's initialize()` method:

```
    /**
     * Initialize method
     *
     * @return void
     */
    public function initialize()
    {
        parent::initialize();

        // .... other code here.

        if (Plugin::isLoaded('Fr3nch13/Jira')) {
            $this->loadHelper('Jira', ['className' => 'Fr3nch13/Jira.Jira']);
        }

        // .... other code here.
    }
```

This plugin makes use of [josegonzalez/dotenv](https://github.com/josegonzalez/php-dotenv). If you're using his extension, than put the below in your `config/.env` file:

```
##### Jira Settings. (if the JIRA plugin is active.)
export JIRA_SCHEMA=""
## name: Protocol
## desc: The protocol that the Jira server uses. Either http, or https
## default: https
## type: select
## options: {"http": "http", "https": "https"}
export JIRA_HOST=""
## name: Hostname
## desc: The full hostname to the Jira server
## default: jira.domain.com
## type: string
export JIRA_USERNAME=''
## name: Username
## desc: The username to use when authenticating with Jira.
## default: jirausername
## type: string
export JIRA_API_KEY=''
## name: API Key
## desc: The API Key to authenticate with Jira.
## default: jiraapikey
## type: string
export JIRA_PROJECT_KEY=''
## name: Project Key
## desc: The Key of the Project in Jira that represents this app.
## default: jiraprojectkey
## type: string
```

This plugin's `src/Plugin.php's bootstrap()` will automatically read these into Cakephp's Configure static class.

If you're not using `dotenv`, then put this in your `config/app.php` file:

```
/// ... previous settings.
    'Jira' => [
        'schema' => 'https',
        'host' => 'jira.domain.com',
        'username' => 'your-jira-username',
        'apiKey' => 'you-jira-username-or-api-key',
        'projectKey' => 'your-project-key', // The code before the issue id ex: PROJECT-81, it would be PROJECT.
    ]
/// ... more settings.
```

Usage
-----

[](#usage)

The primary entry point is the Jira Helper.

I have also added the ability to send Issues to your Jira server.

The 2 default/preconfigured Issues are Bugs and Feature Requests, but you can configure your own as well.

To create your own Issue setup, see these as examples:

- [`Fr3nch\Jira\Controller\TestsController`](blob/master/src/Controller/TestsController.php)
- [`Fr3nch\Jira\Form\TestForm`](blob/master/src/Form/TestForm.php) &lt;-- How you define another Issue type. see the `__construct()` method.
- [`templates/Tests/add.php`](blob/master/templates/Tests/add.php)
- [`templates/Tests/thankyou.php`](blob/master/templates/Tests/thankyou.php)

In my particular instance, I have the links as part of a dropdown menu in my apps' header. My apps use the AdmilLte/bootstrap template/frontend, so if you want, you can include the element existing here like so:

```
