Highlighted
Occasional contributor

Passing attachments to remedy via API

Jump to solution
Has anyone does this before? We have no idea how to do this. When the user (In App Portal) completes a form, we have it open a remedy ticket via the API. They have the option to attach a file to their request in App Portal. We can't seem to get the file to pass over to Remedy.
0 Kudos
1 Solution

Accepted Solutions
Highlighted
Moderator Moderator
Moderator

Re: Passing attachments to remedy via API

Jump to solution

I assume that you're not having any trouble creating the ticket and populating form fields with data from your App Portal questions/answers and that it's just the attachment you're having trouble populating?

Unfortunately, I don't have a Remedy instance to test with and no API documentation, so that could make this a little more challenging.  But it looks like the WSDL should have some attachment related fields similar to the following...

    <xsd:element name="Attachment_Status" type="s0:Attachment_StatusType"/>
    <xsd:element name="Attachment1_attachmentName" type="xsd:string"/>
    <xsd:element name="Attachment1_attachmentData" type="xsd:base64Binary"/>
    <xsd:element name="Attachment1_attachmentOrigSize" type="xsd:int"/>

Do you see something along those lines in your WSDL?  If so, you would use those fields to upload the attachment.  Now since the uploaded files are not exposed as request variables, you can create the ticket using the ITSM integration, but then you'll need to create a script (e.g. PowerShell) to get the attachment data from the App Portal database and make a second web service call to Remedy to attach the file to the newly created ticket.  You can add that script as a second action on the same event that you use for the initial ITSM integration web service call.

The data you're looking for is stored in two tables in the App Portal database.  WD_Uploads will have the file metadata, while WD_UploadData stores the binary content (I believe it should be Base64 encoded, which is what you need for Remedy).  A SQL query like the following will get you the details you need for the API (Note: I included ContentType even though it doesn't appear the Remedy API needs that)...

SELECT u.[FileName] AS attachmentName, ud.[BinaryData] AS attachmentData, u.[FileSize] AS attachmentOrigSize, ud.[ContentType]
FROM [WD_Uploads] u
JOIN [WD_UploadData] ud ON u.[UploadID] = ud.[UploadID] AND u.[GUID] = ud.[UploadGUID]

I have no idea what the Attachment_Status should be, so you'll need to look that one up in the API documentation or ask BMC.

 

Anything expressed here is my own view and not necessarily that of my employer, Flexera. If my reply answers a question you have raised, please click "ACCEPT AS SOLUTION".

View solution in original post

0 Kudos
3 Replies
Highlighted
Pilgrim

Re: Passing attachments to remedy via API

Jump to solution
What do they want to send over into the request in Remedy and why? The solution does support the upload of files, however, they are stored as bubbles within the DB and not easily accessible for an API-related process.
0 Kudos
Highlighted
Occasional contributor

Re: Passing attachments to remedy via API

Jump to solution
We use remedy to work Software orders. App Portal is the request portal for our users. If they can't find an item, they use the "Software not found" catalog item. They fill out a form and we want all the data, including any attachments, to be sent over to Remedy via the API.
0 Kudos
Highlighted
Moderator Moderator
Moderator

Re: Passing attachments to remedy via API

Jump to solution

I assume that you're not having any trouble creating the ticket and populating form fields with data from your App Portal questions/answers and that it's just the attachment you're having trouble populating?

Unfortunately, I don't have a Remedy instance to test with and no API documentation, so that could make this a little more challenging.  But it looks like the WSDL should have some attachment related fields similar to the following...

    <xsd:element name="Attachment_Status" type="s0:Attachment_StatusType"/>
    <xsd:element name="Attachment1_attachmentName" type="xsd:string"/>
    <xsd:element name="Attachment1_attachmentData" type="xsd:base64Binary"/>
    <xsd:element name="Attachment1_attachmentOrigSize" type="xsd:int"/>

Do you see something along those lines in your WSDL?  If so, you would use those fields to upload the attachment.  Now since the uploaded files are not exposed as request variables, you can create the ticket using the ITSM integration, but then you'll need to create a script (e.g. PowerShell) to get the attachment data from the App Portal database and make a second web service call to Remedy to attach the file to the newly created ticket.  You can add that script as a second action on the same event that you use for the initial ITSM integration web service call.

The data you're looking for is stored in two tables in the App Portal database.  WD_Uploads will have the file metadata, while WD_UploadData stores the binary content (I believe it should be Base64 encoded, which is what you need for Remedy).  A SQL query like the following will get you the details you need for the API (Note: I included ContentType even though it doesn't appear the Remedy API needs that)...

SELECT u.[FileName] AS attachmentName, ud.[BinaryData] AS attachmentData, u.[FileSize] AS attachmentOrigSize, ud.[ContentType]
FROM [WD_Uploads] u
JOIN [WD_UploadData] ud ON u.[UploadID] = ud.[UploadID] AND u.[GUID] = ud.[UploadGUID]

I have no idea what the Attachment_Status should be, so you'll need to look that one up in the API documentation or ask BMC.

 

Anything expressed here is my own view and not necessarily that of my employer, Flexera. If my reply answers a question you have raised, please click "ACCEPT AS SOLUTION".

View solution in original post

0 Kudos