I am creating JIRA Subtask using the below in POSTMAN:
URL:https://<host>/rest/api/2/issue/
{
"fields":
{
"project":
{
"key": Test"
},
"parent":
{
"key": "Test-123"
},
"summary": "Sub-task of Test-123",
"description": "Don't forget to do this too.",
"issuetype":
{
"id": "5"
}
}
}
In the response "key" is generated.
Using the above "key" how do I add attachments to the above subtask created?
what will be the request format?
Hi @Nitin Mane,
checkout Atlassian's docs on the REST API about adding an attachment to an issue. Adding attachments for subtasks work exactly the same as for other issues with a POST to https://<host>/rest/api/2/issue/{issueIdOrKey}/attachments
BTW: There is also a postman collection with all of the Jira's endpoints.
Cheers,
Matthias.
Hi @Matthias Gaiser (K15t Software)
Thanks for your reply.
My goal is create subtask, once subtask is created add attachment to it, attachment can be dynamic.
The postman works in the below format to upload an attachment.
set method type to POST.
Then select Body -> form-data -> Enter your parameter name
and on right side next to value column, there will be dropdown "text, file", select File. choose your image file and post it.
Is it possible to in key value format ?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Nitin Mane,
What do you mean with key value format?
According to the Atlassian docs, you have to send the http request as a multipart/form-data request. And the name of the multipart/form-data parameter that contains the attachments must be file.
I don't think Postman has a more dynamic behaviour for that - but maybe someone else knows more.
Cheers,
Matthias.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Matthias Gaiser
I meant how to achieve via RAW text or Json not in form data request, because the image which is uploaded is dynamic.The image and txt file is stored in my local.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I believe this is not possible. If you want to have a more dynamic behavior, you could script it outside of postman. But you still need to send the request as form data.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.