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

How To Use SOAPUI To Attach A File To A Ticket


Article ID: 92695


Updated On:


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


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.


CA Service Desk 17.1 and higher.


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

        { "doc_rep:1002" }

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
        { "cr:400307" }

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

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