Jira HTTP bad request "Project is required"

Hi I am getting an error 

HTTP Bad request 400

(  "Errormessages " : [], "errors":("project": "Project is required"))

 

my curl command=

curl -D- --user POST --data @C:\Adwait\AdwaitWorkspace\WS2\Login\jira\createJiraIssue.json -H "Authorization: Basic Yuuuuuu" -H "Content-Type: application/json" "http://xxxxx/rest/api/2/issue" -k -o C:\Adwait\AdwaitWorkspace\WS2\Login\jira\createJiraIssue-Output.json

 

my json=

{
"fields":
{
"project":
{
"key":"DevOps_Touch & Feel (DF)"
},"summary":"Performance test","description":"","environment":"","assignee":{"name":"A","emailAddress":"emailid_assignee"},"issuetype":{"name":"Bug"},"labels":["Automation"],"customfield_10222":[{"value":"Test1"}]}}

2 answers

"project": {
    "key":"DevOps_Touch & Feel (DF)"
}

That is definitely not the Project Key, looks more like the Name.

yes that is the name. What do i need to give as key?

Well.. the Project Key, obviously.

ASDDDD or REWR or RQW in the following example

projectkey.PNG

Were you able to resolve it, Even after adding key , I am getting issue

JSONObject fields = new JSONObject();
JSONObject project = new JSONObject();
project.put("key", "1");
project.put("id", "intqm");
project.put("name","sample");
fields.put("project",project);
//fields.put("project", "1");
// fields.put("issuetype", new JSONObject().put("id", issuetypeid.toString()));
// fields.put("summary", "Test from JiraRestClient");
//fields.put("description", "Lorem ipsum...");

JSONObject issue = new JSONObject();
issue.put("fields", fields);

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Published Sunday in Agility

You asked for it, so we delivered: images on issues have arrived

A picture tells a thousand words. And agility boards have just released their latest feature: cover images on issues – so now your board can tell a story at first glance. Upload attachmen...

795 views 3 11
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you