create jira issue c# using rest api

Koushik Dey
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
March 3, 2019

I am unable to create an issue using Rest Api of Jira, please help me , where is my probem 

 

My url: https://aa.xxx.net/rest/api/2/issue/createmeta

here I didn't provide the actual Url  for safety.

Body :

{
"fields": {
"project":
{
"key": "CHAT"
},
"summary": "Test Rest API",
"description": "Creating of an issue using project keys and issue type names using the REST API",
"issuetype": {
"name": "Task"
}
}
}

and method = "Post" and content type = application/json

2 answers

1 accepted

1 vote
Answer accepted
Claudiu Lionte
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
March 4, 2019

Hi Koushik,

First, what is the http status that you receive when POST-ing this to Jira? This might tell you what exactly is failing. It can be that a field is required and you're not providing it or it could be that you're not authenticated.

Make sure that the user you are using to authenticate the calls has the create issue permission. You might wanna use API Tokens for basic auth. Then, please check the documentation for syntax here:

https://developer.atlassian.com/cloud/jira/platform/rest/v3/#api-api-3-issue-post

Claudiu

Koushik Dey
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
March 7, 2019

Hello Claudiu Lionte

I am getting the error 405 Method Not Allowed

I am using google crome advanced rest clicent, with 

Method : Post

Url : https://xxx.atlassian.net/rest/api/2/issue/createmeta

Content Type : Application/Json

Authorization : [base 64 conversion of my username and password] 

Json Body :

{
"fields": {
"project": {
"key": "DMTP"
},
"summary": "Test Rest API",
"description": "Creating of an issue using project keys and issue type names using the REST API",
"issuetype": {
"name": "Task"
}
}
}

I have permission to create Task in Jira by my login username and password. Also I have an administrator privilege.

Now please help me what should be my next step. 

Deleted user July 9, 2019

@Koushik Dey Were you able to resolve issue ?
I am getting 302 error for same setup

0 votes
Bhanu
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 23, 2020

Hi @Koushik Dey 

Use the POST method and url should be https://xxx.atlassian.net/rest/api/2/issue/ not https://xxx.atlassian.net/rest/api/2/issue/createmeta

The later URL gets the data that needs to be populated at the time of creation of the issue

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events