File not being attached to an issue using REST in Coldfusion

Thomas Lutterman
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
March 7, 2019

I'm trying to attach a file uploaded to the temp directory to a JIRA ticket

local.file = fileUpload(getTempDirectory(), attachment);

local.cfhttp = new http(method='POST', url='https://{url}.atlassian.net/rest/api/2/issue/{issue key}/attachments', charset='utf-8', multipart=true, multipartType='form-data');
local.cfhttp.addParam(name='Authorization', value=variables.getToken(), type='header');
local.cfhttp.addParam(name='X-Atlassian-Token', value='nocheck', type='header');
local.cfhttp.addParam(name='File', file=local.file.serverDirectory & '\' & local.file.serverFile, type='file');

local.cfhttp = local.cfhttp.send().getPrefix();
writeDump(local.cfhttp);abort;

I get a 200 response back, but the content only returns the following:

 []

 

Any help would be appreciated.

1 answer

0 votes
Brett Henry
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
November 18, 2022

@Thomas Lutterman Did you ever resolve this.? I'm hitting the same issue on Lucee.

Suggest an answer

Log in or Sign up to answer