[英]inserting to custom_fields when creating Mantis ticket
我正在尝试插入票证中custom_fields中的字段。 我将不得不插入/更新所有custom_fields,但具体来说,在故障单中有一个名为“CSG Director”的字段,我想在创建新故障单时插入并更新值(如果存在)。 我现在如何尝试这样做是错误的。 我可以看到该值不是$ custom的一部分,但无法弄清楚我应该如何插入它。
Mantis门票中的字段是这样的
ID Name value
-- ---- -----
248 Control ID
145 CSG Director Bloggs
200 Complexity
279 Platform
$mantis = New-WebServiceProxy -Uri "http://tickets.mycompany.com/api/soap/mantisconnect.php?wsdl"
$ticketinfo = $mantis.mc_issue_get($($Sec.Username),$($Sec.Password),$ticket)
$ticketUpdate = $ticketinfo
$Custom = New-Object "Microsoft.PowerShell.Commands.NewWebserviceProxy.AutogeneratedTypes.WebServiceProxy3pi_soap_mantisconnect_php_wsdl.ObjectRef"
$Custom.Value = 'ibarnetson'
$Custom.id = 145
$ticketUpdate.custom_fields = $Custom
$mantis.mc_issue_update($($Sec.Username),$($Sec.Password),$ticket,$ticketUpdate)
我也试过用
"Microsoft.PowerShell.Commands.NewWebserviceProxy.AutogeneratedTypes.WebServiceProxy1pi_soap_mantisconnect_php_wsdl.CustomFieldValueForIssueData"
我收到这个错误
The property 'Value' cannot be found on this object. Verify that the property exists and can be set.
任何帮助都很受欢迎。
我把它破了,不是很漂亮,但是做了......
$mantis = New-WebServiceProxy -Uri "http://ticketsdemo2.empyreanbenefits.com/api/soap/mantisconnect.php?wsdl"
$issue = New-Object ($mantis.GetType().Namespace + ".issuedata")
$project = New-Object ($mantis.GetType().Namespace + ".ObjectRef")
$project.id = $ProjectId
$project.name = $ProjectName
$Reporter = New-Object ($mantis.GetType().Namespace + ".AccountData")
$Reporter.name = $ReporterName
$Handler = New-Object ($mantis.GetType().Namespace + ".AccountData")
$Handler.name = $HandlerName
$Custom = New-Object ($mantis.GetType().Namespace + ".ObjectRef")
$Custom.id = 145
$CustomFields = New-Object ($mantis.GetType().Namespace + ".CustomFieldValueForIssueData")
$CustomFields.field = $Custom
$CustomFields.value = 'Other'
$issue.custom_fields = $CustomFields
$issue.project = $project
$issue.Reporter = $Reporter
$issue.Handler = $Handler
$issue.summary = $summary
$issue.description = $description
$issue.category = $category
$response = $mantis.mc_issue_add(($Sec.Username),$($Sec.Password),$issue)
Return $response
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.