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).
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.