我正在尝试将票证中的custom_field中的字段插入。我将不得不插入/更新所有Custom_fields,但是具体来说,在票务中,有一个名为" CSG Director"的字段,我想在创建新票证时插入并在现有的情况下更新值。我现在如何尝试这样做是错误的。我可以看到该值不是$自定义的一部分,但无法弄清楚我应该如何插入。
螳螂票中的字段就像这
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