SOAP API to create a private issue

Get help from other users here.

Moderators: Developer, Contributor

Post Reply
zkn0629
Posts: 2
Joined: Feb 22, 2017 10:05 am

SOAP API to create a private issue

Post by zkn0629 » Feb 22, 2017 3:39 pm

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. :)

rombert
Posts: 66
Joined: Nov 05, 2009 3:43 am

Re: SOAP API to create a private issue

Post by rombert » Feb 25, 2017 5:17 pm

Can you post the actual request that is sent to MantisBT?

zkn0629
Posts: 2
Joined: Feb 22, 2017 10:05 am

Re: SOAP API to create a private issue

Post by zkn0629 » Feb 28, 2017 9:54 am

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>

rombert
Posts: 66
Joined: Nov 05, 2009 3:43 am

Re: SOAP API to create a private issue

Post by rombert » Apr 09, 2017 3:22 pm

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>

Post Reply