Hello!
As mentioned in the question above, is there a way to insert a file inside of a Jira forms (with attachment field)?
I believe it should use multiple Jira REST APIs, but I'm not sure which APIs should I use.
Thanks!
Hello!
To address your question, while native Jira forms have limitations with file handling, Smart Forms for Jira provides enhanced options that could meet your needs. With Smart Forms for Jira, you can add an attachment field within the form, allowing users to upload files directly, just like an attachment in Jira issues.
Additionally, Smart Forms for Jira supports embedded content, so you can insert files (like PDFs or documents from accessible online drives) directly into the form itself, making them readable and accessible to users as part of the form content.
This approach combines the benefits of attachments and embedded resources, providing flexibility within Jira forms. If you’re interested, you can find more details on Smart Forms for Jira in the Atlassian Marketplace here.
Let me know if this helps or if you have other questions!
Hey, you can add attachments to a Jira form (like a ticket) using the Jira REST API. You’ll typically need to use two endpoints:
To create a new issue, use:
POST /rest/api/3/issue
Content-Type: application/json
Authorization: Bearer <your_token>
{
"fields": {
"project": { "key": "PROJ" },
"summary": "New Issue with Attachment",
"issuetype": { "name": "Task" }
}
}
This will return an issueId that you’ll use in the next step.
To attach a file, use the POST /rest/api/3/issue/{issueIdOrKey}/attachments endpoint.
POST /rest/api/3/issue/{issueIdOrKey}/attachments
X-Atlassian-Token: no-check
Authorization: Bearer <your_token>
In this case, you’ll need to set up a multipart/form-data request to send the file:
curl -D- -u <email>:<api_token> -X POST -H "X-Atlassian-Token: no-check" -F "file=@/path/to/file" "https://your-domain.atlassian.net/rest/api/3/issue/{issueIdOrKey}/attachments"
Replace /path/to/file with the file path, and {issueIdOrKey} with the ID or key of the issue.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello!
I tried this method, but the result is not what I expect.
As you can see in the image above, this is my goal. Is that possible? Or am I missed something?
Thanks! ^^
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.