通过suds更新JIRA中的自定义级联选择字段
使用JIRA版本4.2。在Python 2.7和suds 0.4中,如何更新问题的自定义级联选择字段(父字段和子字段) 在“Python(SOAPPy)客户端”下有一个可用的。 我使用的是这种类型的更新 例如: 更新父字段customfield_10的级联选择自定义子字段时,需要更新字段customfield_10_1 更新 显示级联字段原始值的代码:通过suds更新JIRA中的自定义级联选择字段,jira,suds,python-2.7,Jira,Suds,Python 2.7,使用JIRA版本4.2。在Python 2.7和suds 0.4中,如何更新问题的自定义级联选择字段(父字段和子字段) 在“Python(SOAPPy)客户端”下有一个可用的。 我使用的是这种类型的更新 例如: 更新父字段customfield_10的级联选择自定义子字段时,需要更新字段customfield_10_1 更新 显示级联字段原始值的代码: issue = client.service.getIssue(auth, "NAHLP-33515") for f in fields:
issue = client.service.getIssue(auth, "NAHLP-33515")
for f in fields:
if f['customfieldId'] == 'customfield_10050' or f['customfieldId'] == 'customfield_10050_1':
print f
这导致:
(RemoteCustomFieldValue){
customfieldId = "customfield_10050"
key = None
values[] =
"10981",
}
(RemoteCustomFieldValue){
customfieldId = "customfield_10050"
key = None
values[] =
"10981",
}
(RemoteCustomFieldValue){
customfieldId = "customfield_10050"
key = "1"
values[] =
"11560",
}
在手动设置级联字段的子字段后,上述代码将导致:
(RemoteCustomFieldValue){
customfieldId = "customfield_10050"
key = None
values[] =
"10981",
}
(RemoteCustomFieldValue){
customfieldId = "customfield_10050"
key = None
values[] =
"10981",
}
(RemoteCustomFieldValue){
customfieldId = "customfield_10050"
key = "1"
values[] =
"11560",
}
以上值是我希望通过SUD实现的
注意key=“1”字段。键值指定此对象是customfield_10050的子对象。: parentKey-用于多维自定义字段,如级联选择列表。在其他情况下为空 让我们尝试发送一个键字段值:
client.service.updateIssue(auth, "NAHLP-33515", [
{"id":"customfield_10050", "values":["10981"]},
{"id":"customfield_10050_1", "key":"1", "values":["11560"]}
])
这会导致错误,因为接受的是[]参数,而不是[]参数():
那么,我们如何传递RemoteCustomFieldValue参数来更新问题呢
更新2,mdoar的答案
通过suds运行以下代码:
client.service.updateIssue(auth, "NAHLP-33515", [
{"id":"customfield_10050", "values":["10981"]},
{"id":"customfield_10050_1", "values":["11560"]}
])`
后值:
(RemoteCustomFieldValue){
customfieldId = "customfield_10050"
key = None
values[] =
"10981",
}
不幸的是,这不会更新customfield_10050的子项。手动验证
分辨率:
client.service.updateIssue(auth, "NAHLP-33515", [
{"id":"customfield_10050", "values":["10981"]},
{"id":"customfield_10050:1", "values":["11560"]}
])
谢谢你,麦道夫!要更新级联选择字段的父字段和子字段,请使用冒号(“:”)指定子字段
工作示例:
client.service.updateIssue(auth, "NAHLP-33515", [
{"id":"customfield_10050", "values":["10981"]},
{"id":"customfield_10050:1", "values":["11560"]}
])
有关更多信息,请参见有关更多信息,请参见通过我的尝试更新了该问题。不幸的是,这不适用于肥皂水。无法忍受在这里使用编辑器,请参阅JCLIMD-9链接以获取答案。我还修复了SOAPpy示例。谢谢!我已使用您的工作示例更新了问题。使用我的尝试更新了问题。不幸的是,这不适用于肥皂水。无法忍受在这里使用编辑器,请参阅JCLIMD-9链接以获取答案。我还修复了SOAPpy示例。谢谢!我已经用你的工作样本更新了这个问题。