Page 1 of 1

SOAP API to create a private issue

Posted: 22 Feb 2017, 20:39
by zkn0629
Hi,

I am using SOAP API to create an issue as /api/soap/mantisconnect.php?wsdl indicates.
Everything works fine with operation: mc_issue_add except when I tried to set the issue view status to private by setting view_state (id - optional) to 50 or (name - optional) to "private"

I am using ruby and savon gem, so the code is like

response = @client.call(:mc_issue_add, message: { username: admin, password: root, \
issue: { project: { name: 'test' }, category: 'general', summary: 'summary', view_state: { id: 50, name: 'private' }, \
description: 'description', handler: { name: 'admin' } } })


The code can generate a ticket , but the view status remains public. I also tried mc_issue_update which does not work too.

Can someone help me with this please? Thanks. :)

Re: SOAP API to create a private issue

Posted: 25 Feb 2017, 22:17
by rombert
Can you post the actual request that is sent to MantisBT?

Re: SOAP API to create a private issue

Posted: 28 Feb 2017, 14:54
by zkn0629
rombert wrote:Can you post the actual request that is sent to MantisBT?
Yes, here is xml request.

SOAP request: http://localhost/Mantis/api/soap/mantisconnect.php
SOAPAction: "http://localhost/Mantis/api/soap/mantis ... _issue_add", Content-Type: text/xml;charset=UTF-8, Content-Length: 1610
<?xml version="1.0" encoding="UTF-8"?><env:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:tns="http://futureware.biz/mantisconnect" xmlns:env="http://schemas.xmlsoap.org/soap/envelop ... pplication Security Request</name></project><category>Internal Transfer</category><viewState><id>50</id><name>private</name></viewState>

Re: SOAP API to create a private issue

Posted: 09 Apr 2017, 20:22
by rombert
That's strange. What version of MantisBT are you running? Does the view_state field have the '50' value in the database?

For the record, this is what works for me - just tried with the latest MantisBT code from git

Code: Select all

<soapenv:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:man="http://futureware.biz/mantisconnect" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
   <soapenv:Header/>
   <soapenv:Body>
      <man:mc_issue_add soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
         <username xsi:type="xsd:string">administrator</username>
         <password xsi:type="xsd:string">root</password>
         <issue xsi:type="man:IssueData">
            <view_state xsi:type="man:ObjectRef">
               <id xsi:type="xsd:integer">50</id>
               <name xsi:type="xsd:string">private</name>
            </view_state>
            <project xsi:type="man:ObjectRef">
               <id xsi:type="xsd:integer">1</id>
            </project>
            <category xsi:type="xsd:string">General</category>
            <summary xsi:type="xsd:string">Test issue</summary>
            <description xsi:type="xsd:String">Some description</description>
         </issue>
      </man:mc_issue_add>
   </soapenv:Body>
</soapenv:Envelope>