hi,
how can i attach a document to an issue with REST API at issue creation time?
without using CURL command , cann't we upload the attachement to JIRA issue using the REST ?
because lot of documents are suggested to go for curl command, but i need to use it from REST API itself.
can anyone help me here!!
Thanks in advance
Community moderators have prevented the ability to post new answers.
Hi Kiran,
I believe you are trying to create an issue and also attachment using REST Api. What is the the language you are using to write this? You will find lot of examples written in PHP.
Refer to this document for all the REST definitions: https://docs.atlassian.com/jira/REST/latest/
This link has some good examples: https://developer.atlassian.com/display/JIRADEV/JIRA+REST+APIs#JIRARESTAPIs-ASimpleExample:CreatinganIssueinJIRA
Regards,
Ravi
Hi Kiran, as far as I know you can't create issues via REST and attach files at the same time. It requires two REST calls. You can see more details here
As for not using CURL and REST API itself, I'm not sure if I understood it right, but I believe you're referring to a different REST client, is that right? If so, you may use JIRA REST client.
I hope it helps.
Cheers
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi Tiago,
thanks for response.
and this jira client i downloaded already but which is not working for me.
i got the client code from atlassian but still those also not working properly.
this bellow code asking to get lot of jars but not runnig
AsynchronousJiraRestClientFactory factory = new AsynchronousJiraRestClientFactory(); final URI jiraServerUri = new URI("http://localhost:2990/jira"); JiraRestClient restClient = factory.createWithBasicHttpAuthentication(jiraServerUri, "admin", "admin"); URI attachURI = new URI("http://localhost:2990/jira/rest/api/2/issue/TEST-14/attachments"); FileInputStream fis =new FileInputStream("hello.txt"); Issue issue = (Issue) restClient.getIssueClient().getIssue("TEST-14").claim();
so i went for another solution and making the rest calls with CURL.
if you have the working client code and jars, please share me.
thanks
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Curl is just a tool that uses REST API. How do you want to execute REST API commands? Anyway, you should form your request using that tool with the same parameters as in curl examples.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
i want to use the rest api to create an issue with attachment (from my local drive) using java JIRA REST api .
if it is not possible , how can i upload the attachment to existing issue in JIRA with Java JIRA REST API ?
these are my questions
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Community moderators have prevented the ability to post new answers.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.