mc_issue_note_add

General discussion of Mantis.

Moderators: Developer, Contributor

Post Reply
Firmbyte
Posts: 11
Joined: 07 Feb 2017, 17:23

mc_issue_note_add

Post by Firmbyte »

I'm Newbie to this and I'm trying to add notes to a ticket using mc_issue_note_add but without success.
I'm doing this:

Code: Select all

$id = "C:\Users\me\Documents\me.xml"
# Read XML configuration file
[xml]$config = Get-Content $id
$UserName = $config.ID.UserName
$Password = $config.ID.Password
$mantis = New-WebServiceProxy -Uri http://tickets.empyreanbenefits.com/api/soap/mantisconnect.php?wsdl
$ticket = "0198346"
$note = @(
             ('text'),
             ('testing mc_issue_note_add')
   )
$mantis.mc_issue_note_add($username,$password,$ticket,$note)
And get this:
Cannot convert argument "note", with value: "System.Object[]", for "mc_issue_note_add" to type
"Microsoft.PowerShell.Commands.NewWebserviceProxy.AutogeneratedTypes.WebServiceProxy1pi_soap_mantisconnect_php_wsdl.IssueNoteData":
"Cannot convert the "System.Object[]" value of type "System.Object[]" to type
"Microsoft.PowerShell.Commands.NewWebserviceProxy.AutogeneratedTypes.WebServiceProxy1pi_soap_mantisconnect_php_wsdl.IssueNoteData"."
At line:1 char:1
+ $mantis.mc_issue_note_add($username,$password,$ticket,$note)
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [], MethodException
+ FullyQualifiedErrorId : MethodArgumentConversionInvalidCastArgument
Any guidance gratefully received.
rombert
Posts: 66
Joined: 05 Nov 2009, 08:43

Re: mc_issue_note_add

Post by rombert »

Hi,

My C# knowledge is rather rusty, but this looks like a compiler error. The mc_issue_note_add expects a IssueNoteData object, but you're passing in an Object array.
Post Reply