I want to find out if JIRA Cloud allows you to send an attachment that has a base64 attachment via a REST call. We are integrated with our EasyVista tool and sending over attachments with a REST call. With JIRA Software (Prem) we were able to use the Tempest Base64 application. This is no longer available in JIRA Cloud Marketplace.
Hi @Eliot Forrest ,
I have finally achieve 2 ways to resolve this.
we can get the BinaryArray using the Attachment Content API after it convert it to base64. You can test this on the Script Console:
def issueKey = 'EXAMPLE-1234'
def result = get('/rest/api/2/issue/' + issueKey)
.header('Content-Type', 'application/json')
.asObject(Map)
if (result.status == 200){
def bodyfields = result.body.fields
def attachment = bodyfields.attachment[0]
def attachmentid = attachment.id
def attachmentfilename = attachment.filename
def attachmenttype = attachment.mimeType
def result2 = get('/rest/api/3/attachment/content/' + attachmentid)
.header('Content-Type', 'application/json')
.asBinary()
def attachmentcontent = result2.body.bytes.encodeBase64().toString()
You would need to use Automation for Jira and Webhooks by Zapier to send and capture attachment related data, such as filename, id, filetype (as you need) and in a second Zapier event you would need to use Code Python by Zapier and use this code:
import requests
import base64
import codecs
id = input_data['idattachment']
url = "https://yourdomain.attlassian.net/rest/api/3/attachment/content/"+id
r=requests.get(url , headers={"Content-Type":"application/json","Authorization":"Basic YOUR_TOKEN","Connection":"keep-alive"}, params={"redirect": "false"})attachment_bytes = r.content
base64input = codecs.encode(attachment_bytes,'base64').decode('utf-8')
attachment_text = bytes(base64input, 'utf-8').decode('utf-8')
return {'bytes':attachment_text }
in both ways you should be able to use the base64 encripted attachment to send it to another app.
I am writing on behalf of Base64 Attachment REST API app Vendor.
Our app is available in Atlassian marketplace for Server and Datacenter versions. Unfortunately we do not have Cloud version yet.
However, we are considering implementation of an Cloud version this year. If you would like to keep in touch about progress on this or has another features to enhance app functionality you can raise an feature request in our support portal.
Michal
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello @Michal Patoprsty Thanks for the response, I will check-in from time to time on the Cloud version.
With that stated, has any figured out how to solve this with the Cloud Version.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Eliot Forrest I would like to inform you that we have successfuly released our Cloud version for Base64 Attachment REST API
Kindly note that installation process is slightly different than datacenter version. More information regarding installation can be found in our documentation
In case you would have any other questions just let me know.
Michal
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.