吉拉肥皂与PHP [英] Jira Soap with a Php

查看:105
本文介绍了吉拉肥皂与PHP的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

关于使用php开发客户端网站以远程调用JiRA的说明,我几乎一无所知.

I have seen little to know instruction on using php to develop a client website to make remote calls to JiRA.

当前,我正在尝试使用JSP/Java创建一个Soap客户端以连接到本地jira实例.我想创建和搜索所有问题.由于使用了Maven2,我们目前存在一些问题,因为我们位于主要的防火墙后面(是的,我已经使用了代理),因此无法从存储库中获取所需的所有文件.

Currently I'm trying to make a soap client using JSP/Java to connect to a local jira instance. I would like to create and search issues that is all. We are currently having some problems using Maven2 and getting all the files we need from the repository since we are behind a major firewall(yes I've used the proxy).

我在PHP方面有丰富的经验,想知道使用PHP soapclient调用是否可以完成这项工作.

I have a lot of experience with PHP and would like to know if using the PHP soapclient calls can get the job done.

http://php.net/manual/en/soapclient.soapclient.php

推荐答案

是的,可以使用 XML- RPC .

使用API​​非常简单-请查看

Using the APIs is pretty much straight forward - have a look at the API documentation to find the right functions for you. your code should look something like :

<?
$soapClient = new SoapClient("https://your.jira/rpc/soap/jirasoapservice-v2?wsdl");
$token = $soapClient->login('user', 'password');
...  
... # get/create/modify issues
... 
?>

添加新评论的示例:

$issueKey = "key-123";
$myComment = "your comment";

$soapClient = new SoapClient("https://your.jira/rpc/soap/jirasoapservice-v2?wsdl");
$token = $soapClient->login('user', 'password');
$soapClient->addComment($token, $issueKey, array('body' => $myComment));

创建问题的示例:

$issue = array(
    'type'=>'1',
    'project'=>'TEST',
    'description'=>'my description',
    'summary'=>'my summary',
    'priority'=>'1',
    'assignee'=>'user',
    'reporter'=>'user',
);
$soapClient = new SoapClient("https://your.jira/rpc/soap/jirasoapservice-v2?wsdl");
$token = $soapClient->login('user', 'password');
$soapClient->createIssue($token, $issue);

请注意,您需要在linux中安装php-soap(或在Windows中等效),才能使用SOAP库.

Note that you need to install php-soap in linux (or it's equivalent in windows) to be able to use the SOAP library.

这篇关于吉拉肥皂与PHP的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆