Hi Community ,
Downloading the attachments for a Particular issue from JIRA is what the user wants. Using integration, I am retrieving the submitted attachments for a certain Issue from JIRA in Appian (url). Afterwards, when the user clicks on the URL, I trigger the integration to save the document in Appian (Folder) so that the user can download it if the download document link is provided in the UI.As you can see there are two clicks are happening .
1. While invoking the integration to save the document .2 .User can download the document if provide download document link in interface.can we do this whole operation in single click ?
Discussion posts and replies are publicly visible
Hi Klaus34,
I hope this can be done using document download API. There are few steps we need to do.
Below is the sample code of the Download Document API
a!localVariables( local!pathArray:/*Add required parameters required to call integration in pathSegments*/ fn!cast('type!{http://www.appian.com/ae/types/2009}Text?list', http!request.pathSegments), local!document:/*Call the integration using the parameters in path segments */ tointeger(index(local!pathArray, 1, null)), local!extensionWhitelist: {"pdf", "txt", "png", "jpg", "jpeg"}, if( /* * The path must be only 1 value, the document ID, and that ID must be a number. * Otherwise, we return a 404 Not Found */ or( isnull(local!document), not(contains(local!extensionWhitelist, document(local!document, "extension"))) ), a!httpResponse( statusCode: 404, body: "404 Not Found", headers: {} ), a!httpResponse( /* * If the query parameter "attachment" is set to true, * set an HTTP header that tells the client that the body of the response * should be downloaded. This overrides the default content-disposition * of "inline; filename=<filename>.<extension>". We will automatically * set the content-type and length. */ headers: if( http!request.queryParameters.attachment, a!httpHeader( name: "Content-Disposition", value: concat( "attachment; filename=""", document(local!document, "name"), ".", document(local!document, "extension"), """" ) ), {} ), body: todocument(local!document) ) ) )
No. You can find a huge number of discussions on that topic here.
HiThanks for your reply ,Can you guide me little bit more>> on this as i am having below objects1. Integration which will return the URL of attachments.2. And same URL i will be passing in one of the start process model which is calling one more integration to save document in Appian .now i want to download the document through Web API