Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

REST API PUT Returns 400 Error

mark Sisson November 17, 2012
I'm trying to update a JIRA issue via the REST API but the server is return a 400 error saying "Action Type=Field 'Action Type' cannot be set. It is not on the appropriate screen, or unknown". The fields that Im trying to update are custom fields, not the standard fields that ship with JIRA.
Any ideas?
REQUEST
PUT http://jira/rest/api/2/issue/QA-249?os_username=YYY&os_password=ZZZ HTTP/1.1
User-Agent: Fiddler
Host: jira
Content-Type: application/json
Content-Length: 142
{ 
  "fields" : { 
       "Action Type" : "Create", "Control Type" : "ContextMenu", "Record Type" : "Collateral", "Tech" : ".Net" 
   } 
}

RESPONSE
HTTP/1.1 400 Bad Request
Server: Apache-Coyote/1.1
X-AREQUESTID: 1406x840487x1
Set-Cookie: JSESSIONID=88CF9FA962312A8D343C9B8CB70F7A37; Path=/; HttpOnly
X-Seraph-LoginReason: OK
Set-Cookie: atlassian.xsrf.token=BC7N-JLJA-FWP5-ARJ2|6c4ad34d683a7cd329af63c3c4ed7936258364c4|lin; Path=/
X-AUSERNAME: msisson
Cache-Control: no-cache, no-store, no-transform
Content-Type: application/json;charset=UTF-8
Transfer-Encoding: chunked
Date: Sun, 18 Nov 2012 07:26:30 GMT
Connection: close
1a3
{"errorMessages":[],"errors":{"Action Type":"Field 'Action Type' cannot be set. It is not on the appropriate screen, or unknown.","Record Type":"Field 'Record Type' cannot be set. It is not on the appropriate screen, or unknown.","Tech":"Field 'Tech' cannot be set. It is not on the appropriate screen, or unknown.","Control Type":"Field 'Control Type' cannot be set. It is not on the appropriate screen, or unknown."}}
0

2 answers

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

0 votes
Faisal
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.
November 21, 2012

Hi Mark,

My apology for the delay here. I did a quick test on my end, and by using the JSON example specified in your question, I could reproduce the same problem on my end.

Hence, I think the problem occurs because of the incorrect JSON being specified to update the custom fields in for the issue QA-249.

Anyway, I am able to update a custom field select list by running the following cURL command with the example JSON below:

curl -D- -u admin:admin -X PUT --data @/Users/BaBs/Desktop/cf.json -H "Content-Type: application/json" http://afaisal-pc:8082/jira/rest/api/2/issue/PCF-2

HTTP/1.1 204 No Content

Server: Apache-Coyote/1.1

X-AREQUESTID: 914x424x1

Set-Cookie: JSESSIONID=30A5359EB1D0482399E5ADF83452D6A5; Path=/jira; HttpOnly

X-Seraph-LoginReason: OK

Set-Cookie: atlassian.xsrf.token=BC4N-X1C7-GM04-MH36|a052815e94177b278f94b1ca967be0382d181e6d|lin; Path=/jira

X-ASESSIONID: 1bzt7w1

X-AUSERNAME: admin


Date: Thu, 22 Nov 2012 07:14:19 GMT

Example of the JSON data:

{ 
  "fields" : { 
       "customfield_10200" : {"value" : "Test 1"}, 
       "customfield_10201" : {"value" : "Value 1"}
   } 
}

I hope that the info above helps!

Cheers.

0 votes
Faisal
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.
November 19, 2012

Hi Mark,

Perhaps the problem could happen because the mentioned custom fields are not mapped to the screen mapped to the Edit Issue operation in the Screen Schemes. Hence, can you kindly check if the custom fields are listed in the Edit issue screen, for the issue QA-249?

mark Sisson November 19, 2012

thanks for the response Ahmad. Here's a screenshot of the edit screen for issue QA-249. The Action Type field is certainly there. And the login user that I'm using for both my web session and the REST call are the same.

Any other ideas? Is it worth trying to bounce JIRA?

TAGS
AUG Leaders

Atlassian Community Events