I have created a very simple test script to figure out how to attach a file to an issue. The "file" is actually just text that I want to create a file. Since this is in the Cloud, I am assuming that I can't write the file to a temp file in order to import it.
import org.apache.http.entity.ContentType;
String text = "This is a simple set of text"
def response = Unirest.post("/rest/api/3/issue/CDFT-1/attachments")
.header("Accept", "application/json")
.header("Content-Type", "text/plain")
.header("X-Atlassian-Token", "no-check")
.field("file", text.getBytes(), "text.txt")
.asJson();
I get a 415 - Unsupported Media Type error from this. Any help is welcome
Where are you running this script? and can you share the link from where you copied it?
Thanks,
Ravi
Hi. I copied from:
https://library.adaptavist.com/entity/copy-field-value-from-linked-issue
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.