bluetea/jira-rest-api

Atlassian JIRA REST API PHP 库

dev-master 2015-04-22 14:38 UTC

This package is not auto-updated.

Last update: 2024-09-24 02:29:02 UTC


README

Atlassian JIRA 包含一个 REST API。使用这个 PHP 库,您可以以面向对象的方式使用这个 REST API。如果您想在 Symfony2 项目中使用这个库,一个 Symfony2 扩展包将很快可用!

用法

用法非常简单!首先设置与您的 Atlassian JIRA 服务器的连接,然后调用一些端点。

<?php

namespace Acme\DemoBundle\Controller;

use Bluetea\Api\Authentication\BasicAuthentication;
use Bluetea\Api\Client\CurlClient;
use Bluetea\Api\Client\GuzzleClient;
use Bluetea\Jira\Endpoint\ProjectEndpoint;


class TestController extends Controller
{
    public function testAction()
    {
        $apiClient = new GuzzleClient(
            'https://atlassian.yourdomain.com/rest/api/2',
            new BasicAuthentication('username', 'password')
        );

        $projectEndpoint = new ProjectEndpoint($apiClient);
        // Get all projects
        return new JsonResponse($projectEndpoint->findAll());
    }
}

查看 Jira/Endpoint 命名空间以获取更多端点和操作。请帮助我们添加所有 JIRA 端点,通过提交 PR 做出贡献!

文档

JIRA 6.3.10 REST API 文档 JIRA REST API 开发者文档

调试

安装 JIRA REST API 浏览器来测试您的调用。您可以在 https://atlassian.yourdomain.com/plugins/servlet/restbrowser 找到它。您收到 404 错误?请先通过插件管理器安装插件。