简体   繁体   English

使用Jira SOAP API更新基本字段

[英]Updating basic fields with Jira SOAP API

I am working with the Jira SOAP API, and I have managed to read from an issue and to create new issues. 我正在使用Jira SOAP API,我设法从一个问题中读取并创建新问题。 However, I am having trouble with updating the fields of an already existing issue. 但是,我在更新已存在问题的字段时遇到问题。 I make changes to the fields, but they do not persist after the program stops running. 我对字段进行了更改,但在程序停止运行后它们不会保留。

I know that the method to use is likely the updateIssue(...) method, but I haven't been able to attempt using it, as I don't know what to pass for the last parameter. 我知道使用的方法可能是updateIssue(...)方法,但是我无法尝试使用它,因为我不知道要为最后一个参数传递什么。 I looked at the documentation, but don't understand what the RemoteFieldValue[] is. 我查看了文档,但不明白RemoteFieldValue []是什么。

Can someone please tell me how I could create a RemoteFieldValue[] that I could pass to the updateIssue method in order to update basic fields like summary, description, etc.? 有人可以告诉我如何创建一个RemoteFieldValue [],我可以传递给updateIssue方法,以更新摘要,描述等基本字段?

Thanks! 谢谢!

To update basic fields using Jira SOAP you need to use updateIssue() (as you suspected). 要使用Jira SOAP更新基本字段,您需要使用updateIssue()(如您所怀疑的那样)。

updateIssue(java.lang.String token, java.lang.String issueKey, RemoteFieldValue[] actionParams) 

RemoteFieldValue constructor takes two parameters: fieldID and newFieldValues RemoteFieldValue构造函数有两个参数:fieldID和newFieldValues

public RemoteFieldValue(java.lang.String fieldID,
                        java.lang.String[] newFieldValues)

Where fieldID for standard fields is a name of the field ("summary", "description", etc.) 其中标准字段的fieldID是字段的名称(“摘要”,“描述”等)

Here is an example: 这是一个例子:

List<RemoteFieldValue> actionParams = new List<RemoteFieldValue>();

RemoteFieldValue description = new RemoteFieldValue { 
    id = "description", 
    values = new string[] { "here is new description" } };

actionParams.Add(description);

jiraSoapService.updateIssue(token, issueKey, actionParams.ToArray());

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM