<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://community.appian.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Jira Integrations- User wants to download the attachments of particular Issue in Appian</title><link>https://community.appian.com/discussions/f/general/30569/jira-integrations--user-wants-to-download-the-attachments-of-particular-issue-in-appian</link><description>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</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: Jira Integrations- User wants to download the attachments of particular Issue in Appian</title><link>https://community.appian.com/thread/121782?ContentTypeID=1</link><pubDate>Thu, 16 Nov 2023 09:43:36 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:f819c89a-9dca-4de6-89b0-5782e31b274e</guid><dc:creator>Klaus34</dc:creator><description>&lt;p&gt;Hi&lt;br /&gt;Thanks for your reply ,Can you&amp;nbsp; guide me little bit more&amp;gt;&amp;gt; on this as i am having below objects&lt;br /&gt;&lt;br /&gt;1. Integration which will return the URL of attachments.&lt;br /&gt;2. And same URL i will be passing in one of the start process model&amp;nbsp; which is calling one more integration to save document in Appian .&lt;br /&gt;&lt;br /&gt;now i want to download the document through Web API&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Jira Integrations- User wants to download the attachments of particular Issue in Appian</title><link>https://community.appian.com/thread/121476?ContentTypeID=1</link><pubDate>Wed, 08 Nov 2023 11:58:08 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:6ef503f1-77db-48bb-9cbf-cee8680f9cab</guid><dc:creator>Stefan Helzle</dc:creator><description>&lt;p&gt;No. You can find a huge number of discussions on that topic here.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Jira Integrations- User wants to download the attachments of particular Issue in Appian</title><link>https://community.appian.com/thread/121475?ContentTypeID=1</link><pubDate>Wed, 08 Nov 2023 11:56:50 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:9bc3d571-b8a4-42f9-82af-a5a5b0c25c64</guid><dc:creator>Sri Ram Kaja</dc:creator><description>&lt;p&gt;Hi&amp;nbsp;&lt;a href="/members/harmanjots514"&gt;Klaus34&lt;/a&gt;,&lt;/p&gt;
&lt;p&gt;I hope this can be done using document download API. There are few steps we need to do.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Please create document downlaod API.&lt;/li&gt;
&lt;li&gt;The parameters required for calling the integration which will return the document will be added in path segments of API url.&lt;/li&gt;
&lt;li&gt;Call the integration which will return the document id using the values we get from path and save it in local variable.&lt;/li&gt;
&lt;li&gt;then once you get the document, use it in http response body.&lt;/li&gt;
&lt;li&gt;Now in the interface, use the API url as SafeLink with parameters added in path.&lt;/li&gt;
&lt;li&gt;In single click, document will be downloaded&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Below is the sample code of the Download Document API&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;a!localVariables(
local!pathArray:/*Add required parameters required to call integration in pathSegments*/
fn!cast(&amp;#39;type!{http://www.appian.com/ae/types/2009}Text?list&amp;#39;, http!request.pathSegments),
local!document:/*Call the integration using the parameters in path segments */
tointeger(index(local!pathArray, 1, null)),

local!extensionWhitelist: {&amp;quot;pdf&amp;quot;, &amp;quot;txt&amp;quot;, &amp;quot;png&amp;quot;, &amp;quot;jpg&amp;quot;, &amp;quot;jpeg&amp;quot;},
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, &amp;quot;extension&amp;quot;)))
),
a!httpResponse(
statusCode: 404,
body: &amp;quot;404 Not Found&amp;quot;,
headers: {}
),
a!httpResponse(
/*
* If the query parameter &amp;quot;attachment&amp;quot; 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 &amp;quot;inline; filename=&amp;lt;filename&amp;gt;.&amp;lt;extension&amp;gt;&amp;quot;. We will automatically
* set the content-type and length.
*/
headers: if(
http!request.queryParameters.attachment,
a!httpHeader(
name: &amp;quot;Content-Disposition&amp;quot;,
value: concat(
&amp;quot;attachment; filename=&amp;quot;&amp;quot;&amp;quot;,
document(local!document, &amp;quot;name&amp;quot;),
&amp;quot;.&amp;quot;,
document(local!document, &amp;quot;extension&amp;quot;),
&amp;quot;&amp;quot;&amp;quot;&amp;quot;
)
),
{}
),
body: todocument(local!document)
)
)
)&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>