CA Service Management

  • 1.  Read comments from incident via Webservice

    Posted Aug 13, 2018 10:50 AM

    Hi all,

     

    I'm Phil, a new member here in the CA community and I need a little advice for an Log Comment handle via WebServices.

    I want to read all all comments to an given cr (incident) into a list and then transfer them to an 3rd party system.

    So far, I tried the getRelatedListValues method from the webservice but I'm not shure wether this ist the correct method nor what listName should I use. Currently I go for this request:

     

    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ser="http://www.ca.com/UnicenterServicePlus/ServiceDesk">
       <soapenv:Header/>
       <soapenv:Body>
          <ser:getRelatedListValues>
             <sid>1239183159</sid>
             <objectHandle>cr:55766861</objectHandle>
             <listName>alg</listName>
             <numToFetch>10</numToFetch>
             <attributes>
            <string>log.description</string>
             </attributes>
             <getRelatedListValuesResult>?</getRelatedListValuesResult>
             <numRowsFound></numRowsFound>
          </ser:getRelatedListValues>
       </soapenv:Body>
    </soapenv:Envelope>

     

    My question(s) are now:

    - Can I get a list with all valid <UDSObject> list

    - what listName / attributes combination can I use to receive the following informtions:

    -- text

    -- date of createion

    for the log comment.

     

    Thank you in advance,

    Phil



  • 2.  Re: Read comments from incident via Webservice
    Best Answer

    Posted Aug 13, 2018 12:07 PM

    Hi Phil,

    you can try to use doSelect method, here is an exapmle:

    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ser="http://www.ca.com/UnicenterServicePlus/ServiceDesk">
    <soapenv:Header/>
    <soapenv:Body>
    <ser:doSelect>
         <sid>123456</sid>
         <objectType>alg</objectType>
         <whereClause>call_req_id = 'cr:123456'</whereClause>
         <maxRows>255</maxRows>
         <attributes>
              <!--1 or more repetitions:-->
              <string>id</string>
              <string>description</string>
              <string>time_stamp</string>
              <!-- User that created activity -->
              <string>analyst</string>
              <!-- Activity type code -->
              <string>type</string>
         </attributes>
    </ser:doSelect>
    </soapenv:Body>
    </soapenv:Envelope>

    Regards.



  • 3.  Re: Read comments from incident via Webservice

    Posted Aug 14, 2018 04:43 AM

    Hi cdtj,

    Thank you very much, this is doing the job.

    Best regards,

    Phil



  • 4.  Re: Read comments from incident via Webservice

    Posted Oct 08, 2018 06:37 PM

    Can you please help me with the sample SOAP Request to fetch the incident information from ca service desk based on summary and status and ci name using web services. I am using the below but not returning except handle and length is zero. 

     

    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" x
    mlns:ser="http://www.ca.com/UnicenterServicePlus/ServiceDesk">
    <soapenv:Header/>
    <soapenv:Body>
    <ser:doQuery>
    <sid>163624873</sid>
    <objectType>cr</objectType>
    <whereClause>type.id = 182 and summary like '%test incident%'</whereClause>
    </ser:doQuery>
    </soapenv:Body>
    </soapenv:Envelope>



  • 5.  Re: Read comments from incident via Webservice

    Posted Oct 08, 2018 11:18 PM

    Hi,

     

    please consider the following:

     

    1. In the Where clause, I would usually use type = 'I' rather than 'type.id=182'.  But if you specify the 'objectType' as 'in' (just Incidents) rather than 'cr' (all Request / Incident / Problem tickets) then you don't need to use 'type' in the where clause at all.

    2. If you want to retrieve specific attributes you might be better to use 'doSelect' rather than 'doQuery', and add to your query a list of attributes to retrieve.  See cdtj's example above.  The 'doQuery' operator only returns a list of handles.

     

    Regards,

    James