Jira PHP SOAP 更新问题不起作用
我尝试使用 PHP 中的 SOAP 更新 Jira 中的问题组件,它没有抛出任何异常,它返回 isuue 但组件从未更新。
有什么想法吗?
这是我的示例代码:
$myIssue="";
$myIssue['components'][] = array("id" => "10769", "name" => "component name");
$soap->updateIssue($auth,"ISSUEKEY", $myIssue);
它只是返回问题,而不对组件进行任何更改。
这是当我打印该变量时从 php 发送的内容:
Array ( [components] => Array ( [0] => Array ( [id] => 10769 [name] => component name ) ) )
I tried updating component for issue in Jira using SOAP in PHP, it didnt throw any exception, it returned isuue but component was never updated.
Any ideas?
here is my sample code:
$myIssue="";
$myIssue['components'][] = array("id" => "10769", "name" => "component name");
$soap->updateIssue($auth,"ISSUEKEY", $myIssue);
It just returns issue without any change to component.
This is what is sent out of php when i print that variable :
Array ( [components] => Array ( [0] => Array ( [id] => 10769 [name] => component name ) ) )
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我不是 PHP 开发人员,但我认为这段代码:
结果是:
我对吗?
这将导致它作为 RemoteFieldValue 数组发送到 JIRA:
如果是这样,我认为这不是 jira 所期望的。我相信它正在期待:
记住Java没有关联数组。所以构造 $myIssue['components'][] 对 Java 来说没有任何意义。 Java也不支持不同类型的多维数组。
更新:
尝试这个(或类似的东西,我的代码没有经过测试):
当我在 ColdFusion 中组合 JIRA 服务时,我将每个 JIRA 对象(用户、问题、RemoteFieldValue 等)实现为 ColdFusion 对象。我怀疑您也可以使用关联数组和数组来完成此操作,但我发现这样更干净,并且更容易适应 JIRA SOAP 服务的期望。
I am not a PHP developer, but I think that this code:
Results in this:
Am I right?
Which would result in this being sent to JIRA as the RemoteFieldValue Array:
If so, I do not think that is what jira is expecting. I believe it is expecting:
Remember that Java does not have associative arrays. So the construct $myIssue['components'][] doesn't mean anything to Java. Java also does not support multi-dimensional arrays of different types.
Update:
Try this (Or something like it, my code is not tested):
When I put together a JIRA service in ColdFusion I implemented each JIRA object (User, Issue, RemoteFieldValue, etc) as a ColdFusion object. I suspect you could also do it with associative arrays and arrays, but I find this cleaner and it makes it easier to adapt to what the JIRA SOAP service expects.
更新字段的最简单方法是传递对象
首先定义类(从 WSDL 生成)
创建对象
然后调用方法
希望这会有所帮助。
The easiest way to update a field is to pass the object
First define the class (generated from the WSDL)
Create object
then call the method
Hope this help.
对我来说 updateIssue 以这种方式工作(php)
定义类(来自 wsdl),
之后这里是更新有问题的“描述”字段的代码。
For me updateIssue works in such way (php)
Defining class (from wsdl)
after that here is a code which updates 'description' field at issue.