<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Upload file to JIRA issue with Web API Services in Digital Exchange</title>
    <link>https://community.blueprism.com/t5/Digital-Exchange/Upload-file-to-JIRA-issue-with-Web-API-Services/m-p/96084#M2895</link>
    <description>Hi All,&lt;BR /&gt;&lt;BR /&gt;I'm looking for some help with uploading attachment to JIRA issue by using POST action in Web API Services with Single or Multiple Files. I tried multiple solutions so far, but with no success. For a single file approach I tried to use various headers like Content-Type equal to application/json, application/pdf, application/x-binary (and binary), application/octet-stream, etc., X-Atlassian-Token: no-check, Content-Disposition: form-data and many many different combinations. All request were made against such endpoint (as per JIRA docu): &lt;SPAN style="text-decoration: underline"&gt;https://jira.{base-url}.net//rest/api/[Version]/issue/[Issue ID]/attachments&lt;/SPAN&gt; (Version = 2). So far I manage to got 2 results that make any sense. In single file case I'm getting status code 415 which means "Unsupported Media Type" and I was sure that I will be able to fix it with proper header name, but no luck so far &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt; (I'm trying to upload binary file loaded to data item/collection). For the multiple files request I'm receiving status 200 but response content is empty, and...the file is not getting uploaded. I also tried to run cmd command with following cURL code and it's working fine:&lt;BR /&gt;
&lt;PRE class="language-markup"&gt;&lt;CODE&gt;curl -D- -u {username}:{password} -X POST -H "X-Atlassian-Token: nocheck" -F "file=@{path/to/file}" &lt;A href="http://{base-url}/rest/api/2/issue/{issue-key}/attachments​" target="test_blank"&gt;http://{base-url}/rest/api/2/issue/{issue-key}/attachments​&lt;/A&gt;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The only problem is the fact that I'm not able to read response content back to Blue Prism, and this is why I would like to have it in Web API Service where I have a lot others actions too. Does anybody have some experience with that?&lt;BR /&gt;&lt;BR /&gt;Some more details:&lt;BR /&gt;I'm on BP 6.10.1, I've removed common headers, other activities are working fine, only file upload is not working.&lt;BR /&gt;&lt;BR /&gt;Thank you in advance!&lt;/P&gt;</description>
    <pubDate>Thu, 16 Sep 2021 15:43:01 GMT</pubDate>
    <dc:creator>MateuszBartczak</dc:creator>
    <dc:date>2021-09-16T15:43:01Z</dc:date>
    <item>
      <title>Upload file to JIRA issue with Web API Services</title>
      <link>https://community.blueprism.com/t5/Digital-Exchange/Upload-file-to-JIRA-issue-with-Web-API-Services/m-p/96084#M2895</link>
      <description>Hi All,&lt;BR /&gt;&lt;BR /&gt;I'm looking for some help with uploading attachment to JIRA issue by using POST action in Web API Services with Single or Multiple Files. I tried multiple solutions so far, but with no success. For a single file approach I tried to use various headers like Content-Type equal to application/json, application/pdf, application/x-binary (and binary), application/octet-stream, etc., X-Atlassian-Token: no-check, Content-Disposition: form-data and many many different combinations. All request were made against such endpoint (as per JIRA docu): &lt;SPAN style="text-decoration: underline"&gt;https://jira.{base-url}.net//rest/api/[Version]/issue/[Issue ID]/attachments&lt;/SPAN&gt; (Version = 2). So far I manage to got 2 results that make any sense. In single file case I'm getting status code 415 which means "Unsupported Media Type" and I was sure that I will be able to fix it with proper header name, but no luck so far &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt; (I'm trying to upload binary file loaded to data item/collection). For the multiple files request I'm receiving status 200 but response content is empty, and...the file is not getting uploaded. I also tried to run cmd command with following cURL code and it's working fine:&lt;BR /&gt;
&lt;PRE class="language-markup"&gt;&lt;CODE&gt;curl -D- -u {username}:{password} -X POST -H "X-Atlassian-Token: nocheck" -F "file=@{path/to/file}" &lt;A href="http://{base-url}/rest/api/2/issue/{issue-key}/attachments​" target="test_blank"&gt;http://{base-url}/rest/api/2/issue/{issue-key}/attachments​&lt;/A&gt;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The only problem is the fact that I'm not able to read response content back to Blue Prism, and this is why I would like to have it in Web API Service where I have a lot others actions too. Does anybody have some experience with that?&lt;BR /&gt;&lt;BR /&gt;Some more details:&lt;BR /&gt;I'm on BP 6.10.1, I've removed common headers, other activities are working fine, only file upload is not working.&lt;BR /&gt;&lt;BR /&gt;Thank you in advance!&lt;/P&gt;</description>
      <pubDate>Thu, 16 Sep 2021 15:43:01 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Digital-Exchange/Upload-file-to-JIRA-issue-with-Web-API-Services/m-p/96084#M2895</guid>
      <dc:creator>MateuszBartczak</dc:creator>
      <dc:date>2021-09-16T15:43:01Z</dc:date>
    </item>
    <item>
      <title>Re: Upload file to JIRA issue with Web API Services</title>
      <link>https://community.blueprism.com/t5/Digital-Exchange/Upload-file-to-JIRA-issue-with-Web-API-Services/m-p/96085#M2896</link>
      <description>Hi &lt;a href="https://community.blueprism.com/t5/user/viewprofilepage/user-id/81"&gt;@MateuszBartczak&lt;/a&gt;,&lt;BR /&gt;&lt;BR /&gt;One thing I noticed from the URL you specified is that you have an extra "/" in there.​ Not sure if that was just a cut-and-paste error, but you'd definitely want to remove that if that's the way the URL is seen in the WebAPI.&lt;BR /&gt;&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="34948.png"&gt;&lt;img src="https://community.blueprism.com/t5/image/serverpage/image-id/35009i516190FD8D1B8E04/image-size/large?v=v2&amp;amp;px=999" role="button" title="34948.png" alt="34948.png" /&gt;&lt;/span&gt;&lt;BR /&gt;Cheers,&lt;BR /&gt;Eric</description>
      <pubDate>Fri, 17 Sep 2021 12:59:30 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Digital-Exchange/Upload-file-to-JIRA-issue-with-Web-API-Services/m-p/96085#M2896</guid>
      <dc:creator>ewilson</dc:creator>
      <dc:date>2021-09-17T12:59:30Z</dc:date>
    </item>
    <item>
      <title>Re: Upload file to JIRA issue with Web API Services</title>
      <link>https://community.blueprism.com/t5/Digital-Exchange/Upload-file-to-JIRA-issue-with-Web-API-Services/m-p/96086#M2897</link>
      <description>You might also take a look at this &lt;A href="https://community.blueprism.com/communities/community-home/digestviewer/view-question?ContributedContentKey=d69dea35-96f4-46b2-ac20-08058f359dc3&amp;amp;CommunityKey=3743dbaa-6766-4a4d-b7ed-9a98b6b1dd01&amp;amp;tab=digestviewer" target="_blank" rel="noopener"&gt;thread&lt;/A&gt;. &lt;A class="user-content-mention" data-sign="@" data-contactkey="f0d30523-0236-4fc5-94f7-499846aae05b" data-tag-text="@Zdeněk Kabátek" href="https://community.blueprism.com/network/profile?UserKey=f0d30523-0236-4fc5-94f7-499846aae05b" data-itemmentionkey="f91b3d71-08bb-48e8-b380-eea3722310dc"&gt;@Zdeněk Kabátek&lt;/A&gt; mentioned that the file contents are sent as a Base64 encoded string. If JIRA is expecting the file contents to show up as a binary stream, that would cause a content mismatch error. In that case, you would need to switch to the Utility - HTTP VBO (or your own code stage) to perform the file submission.&lt;BR /&gt;&lt;BR /&gt;You can use a tool like Fiddler to see exactly what's in the request when it's sent from Blue Prism.&lt;BR /&gt;&lt;BR /&gt;Cheers,&lt;BR /&gt;Eric​</description>
      <pubDate>Fri, 17 Sep 2021 13:07:58 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Digital-Exchange/Upload-file-to-JIRA-issue-with-Web-API-Services/m-p/96086#M2897</guid>
      <dc:creator>ewilson</dc:creator>
      <dc:date>2021-09-17T13:07:58Z</dc:date>
    </item>
    <item>
      <title>Re: Upload file to JIRA issue with Web API Services</title>
      <link>https://community.blueprism.com/t5/Digital-Exchange/Upload-file-to-JIRA-issue-with-Web-API-Services/m-p/96087#M2898</link>
      <description>Hi &lt;a href="https://community.blueprism.com/t5/user/viewprofilepage/user-id/833"&gt;@ewilson&lt;/a&gt;&lt;BR /&gt;&lt;BR /&gt;Thank you for your respond. After many hours of fight I manage to finally made it works directly from Web API Services. Below screenshots from solution:&lt;BR /&gt;​&lt;span class="lia-inline-image-display-wrapper" image-alt="34952.png"&gt;&lt;img src="https://community.blueprism.com/t5/image/serverpage/image-id/35016i38B85901F302767B/image-size/large?v=v2&amp;amp;px=999" role="button" title="34952.png" alt="34952.png" /&gt;&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="34953.png"&gt;&lt;img src="https://community.blueprism.com/t5/image/serverpage/image-id/35017iE564C47914CC4107/image-size/large?v=v2&amp;amp;px=999" role="button" title="34953.png" alt="34953.png" /&gt;&lt;/span&gt;&lt;BR /&gt;The most important part of this solution was to use multiple files method (even if you uploading single file at once), then create an input collection where you can import fields from particular action (by clicking 'Import' button) or reproduce them as per the screenshot:&lt;BR /&gt;&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="34954.png"&gt;&lt;img src="https://community.blueprism.com/t5/image/serverpage/image-id/35014i0F8E241A8D1E717E/image-size/large?v=v2&amp;amp;px=999" role="button" title="34954.png" alt="34954.png" /&gt;&lt;/span&gt;&lt;BR /&gt;'File' field needs to has binary file loaded. In the 'File Name' I put full path to the same file.&lt;SPAN style="text-decoration: underline"&gt;&lt;B&gt; 'Field Name' in this case must be equal to 'file' (without quotes ofc) and 'Content-Type' &lt;/B&gt;&lt;B&gt;&lt;U&gt;equal&lt;/U&gt;&lt;/B&gt;&lt;B&gt; to 'application/octet-stream'. Otherwise JIRA will be responding with status code 200, but no file will be attached.&lt;BR /&gt;&lt;BR /&gt;&lt;/B&gt;&lt;/SPAN&gt;&lt;STRONG&gt;Edit: I forgot to mention that you need also to use Issue KEY, not issue ID as input parameter (e.g. KEY-123, not e.g. 123456). With Issue ID it won't work.&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;With all of that, solution is working perfectly. What I found strange is the header 'Content-Type' that cannot be passed through 'Headers' in API tool, but needs to be defined in Collection.</description>
      <pubDate>Mon, 20 Sep 2021 12:39:29 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Digital-Exchange/Upload-file-to-JIRA-issue-with-Web-API-Services/m-p/96087#M2898</guid>
      <dc:creator>MateuszBartczak</dc:creator>
      <dc:date>2021-09-20T12:39:29Z</dc:date>
    </item>
    <item>
      <title>Re: Upload file to JIRA issue with Web API Services</title>
      <link>https://community.blueprism.com/t5/Digital-Exchange/Upload-file-to-JIRA-issue-with-Web-API-Services/m-p/96088#M2899</link>
      <description>&lt;A class="user-content-mention" data-sign="@" data-contactkey="4cd2a895-c71d-4983-94f3-0e7bee8e3aa5" data-tag-text="@Mateusz Bartczak" href="https://community.blueprism.com/network/profile?UserKey=4cd2a895-c71d-4983-94f3-0e7bee8e3aa5" data-itemmentionkey="67023611-628b-4216-a45c-e7be8ffbf48d"&gt;@Mateusz Bartczak&lt;/A&gt;,&lt;BR /&gt;&lt;BR /&gt;Glad to hear you got it working. So it seems what was required was a multi-part form definition which is what I believe using the “Multiple Files” option gives you.&lt;BR /&gt;&lt;BR /&gt;Cheers,&lt;BR /&gt;Eric​</description>
      <pubDate>Mon, 20 Sep 2021 13:06:40 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Digital-Exchange/Upload-file-to-JIRA-issue-with-Web-API-Services/m-p/96088#M2899</guid>
      <dc:creator>ewilson</dc:creator>
      <dc:date>2021-09-20T13:06:40Z</dc:date>
    </item>
  </channel>
</rss>

