[英]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.