rastor/jira-client
最新稳定版本:0.4.5
Composer 安装命令:
composer require rastor/jira-client
包简介
A simple PHP JIRA REST client
README 文档
README
A simple JIRA REST client for PHP.
The main or killing feature of this library is resolving custom fields of issues.
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 "rastor/jira-client:~0.4"
统计信息
- 总下载量: 69.21k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 20
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2015-05-27