Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Add attachments while creating issue via REST API

Carsten Stepan
Contributor
April 4, 2024

I already read this post Solved: How to attach a file while creating Issue in JIRA ... (atlassian.com) about creating an issue and adding attachments in one go. The proposed solution here was to first create the issue and afterwards add the attachments. This is what I am currently doing.

 

However from the createmeta-Endpoint of my instance it seems I could also add attachments while creating the issue:

{
"startAt": 0,
"maxResults": 50,
"total": 16,
"fields": [
{
"required": false,
"schema": {
"type": "array",
"items": "attachment",
"system": "attachment"
},
"name": "Anhang",
"key": "attachment",
"hasDefaultValue": false,
"operations": [
"set",
"copy"
],
"fieldId": "attachment"
}]
}

Is the configuration from the endpoint whrong or how would do that in a single step? I tried it using the following request in curl:

 

curl -H "Authorization ..." https://myinstance.atlassian.net/rest/api/3/issue -X POST -d '{
"fields": {
"project": { "id": "1234" },
"summary": "my summary",
"description": "my description",
"issuetype": { "name": "Story" }
}
}'

 but unsure how to provide the attchment here (if at all).

1 answer

0 votes
Ramchandra Kudtarkar
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
July 25, 2025

Hi, 

Adding attachment to an issue at the time of creation is not possible and we have a JAC for this https://jira.atlassian.com/browse/JRACLOUD-77434.

In Jira, you need to create an issue first using Create issue and then add the attachment using the Add attachment.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
TAGS
AUG Leaders

Atlassian Community Events