2017 © Pedro Peláez
 

library jira-client

A simple PHP JIRA REST client

image

pbrasseur/jira-client

A simple PHP JIRA REST client

  • Tuesday, May 29, 2018
  • by pbrasseur
  • Repository
  • 1 Watchers
  • 0 Stars
  • 7 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 13 Forks
  • 0 Open issues
  • 25 Versions
  • 133 % Grown

The README.md

JIRA Client

A simple JIRA REST client for PHP., (*1)

The main or killing feature of this library is resolving custom fields of issues., (*2)

Codacy Badge, (*3)

Example

$api = new JiraClient\JiraClient('http://jira.hostname', 'login', 'password');

try {
    // Get an existing issue
    $issue = $api->issue()->get('JRA-123');

    // Print the issue id.
    echo $issue->getId();

    // Print the issue key.
    echo $issue->getKey();

    // Create new issue.
    $newIssue = $api->issue()
        ->create('JIRA', 'Suggestion')
        ->field(Field::SUMMARY, 'My Suggestion')
        ->field(Field::DESCRIPTION, 'Some description')
        ->execute();

    // Print the issue id.
    echo $newIssue->getId();

    $newIssue = $newIssue->update()
        ->field(Field::DESCRIPTION, 'Some new description')
        ->customField(10012, 'Value for custom field')
        ->fieldAdd(Field::LABELS, 'new-label')
        ->execute();

    // Print description of updated issue.
    echo $newIssue->getDescription();

    // Two ways for adding new comment.
    $newIssue->addComment("Some comment content");
    $api->issue()->addComment($newIssue->getKey(), "Another comment content");

    // Add new comment limited to the developer role.
    $newIssue->addComment("Only for developers", "role", "Developers");

    // Get reporter's name.
    $reporterName = $newIssue->getReporter()->getName();

    // Get an array of labels.
    $labels = $newIssue->getLabels();

    // Get an array of transitions for issue
    $transitions = $api->issue()->getTransitions($newIssue->getKey());

    // Executing transitions to change issue status
    $newIssue->transition()->execute(120);

    // Searches for issues using JQL
    $issues = new JiraClient\Request\SearchIterator($api, "project = Test");

    // or another way
    $issues = $api->issue()->search("project = Test");

    // Total count of found issues
    $total = $issues->getTotal();

    foreach ($issues as $issue) {
        $issue->update()
            ->fieldAdd(Field::LABELS, 'new-label')
            ->execute();
    }
} catch (\JiraClient\Exception\JiraException $e) {
    // exception processing
}

Installation

composer require "pbrasseur/jira-client:dev-master"

The Versions

29/05 2018

dev-master

9999999-dev

A simple PHP JIRA REST client

  Sources   Download

MIT

The Requires

 

by Pierre Brasseur

api rest client jira

29/05 2018

1.0.x-dev

1.0.9999999.9999999-dev

A simple PHP JIRA REST client

  Sources   Download

MIT

The Requires

 

by Pierre Brasseur

api rest client jira

28/07 2017

0.4.0

0.4.0.0

A simple PHP JIRA REST client

  Sources   Download

MIT

The Requires

 

api rest client jira

19/05 2017

0.3.17

0.3.17.0

A simple PHP JIRA REST client

  Sources   Download

MIT

The Requires

 

api rest client jira

01/03 2017

0.3.16

0.3.16.0

A simple PHP JIRA REST client

  Sources   Download

MIT

The Requires

 

api rest client jira

21/12 2016

0.3.15

0.3.15.0

A simple PHP JIRA REST client

  Sources   Download

MIT

The Requires

 

api rest client jira

04/12 2016

0.3.14

0.3.14.0

A simple PHP JIRA REST client

  Sources   Download

MIT

The Requires

 

api rest client jira

25/11 2016

0.3.13

0.3.13.0

A simple PHP JIRA REST client

  Sources   Download

MIT

The Requires

 

api rest client jira

23/11 2016

0.3.12

0.3.12.0

A simple PHP JIRA REST client

  Sources   Download

MIT

The Requires

 

api rest client jira

13/07 2016

0.3.11

0.3.11.0

A simple PHP JIRA REST client

  Sources   Download

MIT

The Requires

 

api rest client jira

12/07 2016

0.3.10

0.3.10.0

A simple PHP JIRA REST client

  Sources   Download

MIT

The Requires

 

api rest client jira

19/04 2016

0.3.9

0.3.9.0

A simple PHP JIRA REST client

  Sources   Download

MIT

The Requires

 

api rest client jira

01/03 2016

0.3.7

0.3.7.0

A simple PHP JIRA REST client

  Sources   Download

MIT

The Requires

 

api rest client jira

21/02 2016

0.3.6

0.3.6.0

A simple PHP JIRA REST client

  Sources   Download

MIT

The Requires

 

api rest client jira

04/11 2015

0.3.5

0.3.5.0

A simple PHP JIRA REST client

  Sources   Download

MIT

The Requires

 

api rest client jira

13/10 2015

0.3.4.8

0.3.4.8

A simple PHP JIRA REST client

  Sources   Download

MIT

The Requires

 

api rest client jira

13/10 2015

0.3.4.7

0.3.4.7

A simple PHP JIRA REST client

  Sources   Download

MIT

The Requires

 

api rest client jira

12/10 2015

0.3.4.6

0.3.4.6

A simple PHP JIRA REST client

  Sources   Download

MIT

The Requires

 

api rest client jira

24/09 2015

0.3.4.5

0.3.4.5

A simple PHP JIRA REST client

  Sources   Download

MIT

The Requires

 

api rest client jira

16/09 2015

0.3.4.2

0.3.4.2

A simple PHP JIRA REST client

  Sources   Download

MIT

The Requires

 

api rest client jira

26/08 2015

0.3.4

0.3.4.0

A simple PHP JIRA REST client

  Sources   Download

MIT

The Requires

 

api rest client jira

24/07 2015

0.3.3

0.3.3.0

A simple PHP JIRA REST client

  Sources   Download

MIT

The Requires

 

api rest client jira

02/07 2015

0.3

0.3.0.0

A simple PHP JIRA REST client

  Sources   Download

MIT

The Requires

 

api rest client jira

25/06 2015

0.2

0.2.0.0

A simple PHP JIRA REST client

  Sources   Download

MIT

The Requires

 

api rest client jira

27/05 2015

0.1

0.1.0.0

A simple PHP JIRA REST client

  Sources   Download

MIT

The Requires

 

api rest client jira