How To Use SOAPUI To Attach A File To A Ticket
search cancel

How To Use SOAPUI To Attach A File To A Ticket

book

Article ID: 92695

calendar_today

Updated On:

Products

SUPPORT AUTOMATION- SERVER CA Service Desk Manager - Unified Self Service CA Service Desk Manager CA Service Management - Asset Portfolio Management CA Service Management - Service Desk Manager

Issue/Introduction

Soapui is a common for administrators and programmers to test or even perform real operations for Service Desk/CMDB soap web service API methods. Very often, users may just try to enter the full path name in the fileName argument and this will result in error " Error - could not perform the operation, policy limit exceeded". This tech doc explains what additional steps would need to do successful attachments. 

For createAttachment() syntax, please refer to:

Web Services Attachment-Related Methods

How To Use SOAPUI To Attach A File To A Ticket.

Environment

CA Service Desk 17.1 and higher.

Resolution

createAttachment() can be used to attach a file to an existing ticket.

Please take a look at this example:

Please notice that the repHandle is the attachment repository handle. Usually it is the handle for Service Desk repository so it is static and you can hard code it as "doc_rep:xxxxx".

For example, running

pdm_extract -f "select persid from Document_Repository where sym='Service Desk'"

TABLE Document_Repository

        persid
        { "doc_rep:1002" }
Document_Repository
        rows:1

Shows you can hard code it as "doc_rep:1002".

Also notice that the objectHandle is the ticket handle/persid such as "cr:xxxxx", "chg:xxxx" etc. And again you could use the pdm_extract to retrieve this value if you know the ticket number. For example, for call request 46, you could run:

pdm_extract -f "select persid from Call_Req where ref_num='46'"

TABLE Call_Req
        persid
        { "cr:400307" }
Call_Req
        rows:1

And you use the value "cr:400307" for it.

And fileName explains itself.

After all these ready, click on the Attachments tab and then click on the "+" sign to choose the file you specify in the fileName value. The content type would need to match the file type of fileName file.

For more details, refer to this info

https://www.soapui.org/docs/soap-and-wsdl/attachments.html

And once all these are done, run the request and if it runs fine, you will see the returned attachment persid as attamnt:xxxx