{"errorMessages":[],"errors":{"add":"Field 'add' cannot be set. It is not on the appropriate screen, or unknown."}} - error message is displayed while adding fixVersion data in JIRA using Rest API ? Please let me know what is issue ?
JSON:-
{
"fields": {
"project": {
"id": "244026"
},
"summary": " TestDemo",
"description": "Testing",
"issuetype": {
"name": "Test"
},
"add": {
"fixVersions": [
{
"set": {
"name": "testing"
}
}
]
}
}
}
Hello,
Make sure that the fixversion(s) is present on the Create issue screen for the Test issue type (project settings -> screens).
It is showing below error message after removing square brackets [ ]. Fix version field is displayed in create issue screen. Please find the below screenshot.
Error Message:
{"errorMessages":[],"errors":{"add":"Field 'add' cannot be set. It is not on the appropriate screen, or unknown."}}
JSON
{"fields":{"project":{"id":"244026"},"summary":" Demo","description":"Testing","issuetype":{"name":"Test"},"add":{"fixVersions":{"set":{"name":"tttt"}}}}}
Screenshot
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I unable to add transition type filed also. It is showing same error message and it is available in create issue filed. Please let me know why is it showing error message while adding FixVersion & Transition field ?
Error Message :
{"errorMessages":[],"errors":{"transition":"Field 'transition' cannot be set. It is not on the appropriate screen, or unknown."}}
Adding transition field :
{
"fields": {
"project": {
"id": "244026"
},
"summary": "Demo",
"description": "Testing",
"transition": {
"id": "5"
},
"issuetype": {
"name": "Test"
}
}
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Transition is not a field, it is an action, you need to give it a transition id to perform, with fields to be updated inside that.
Please have a look at https://developer.atlassian.com/cloud/jira/platform/rest/v3/?utm_source=%2Fcloud%2Fjira%2Fplatform%2Frest%2F&utm_medium=302#api-rest-api-3-issue-issueIdOrKey-transitions-post and see how a transition JSON is built properly.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Again, transition is not a field, it is an action. Your data needs to tell Jira which action to take if you want to transition an issue, not try to poke data into a field that is not there.
Your latest comment is about a post that asks a valid question about fields that might be available during a transition, but you've not told us what the error message you get is, so there's not a lot we can do beyond tell you that the post looks fine.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Transitions Query
I got it that transition is a an action. I have query about poke data. JIRA status was updated by using poke data but API response is "204 No Content". So I asked this query. Currently, I am updating JIRA status using poke data and am ignoring 204 No Content response message.
Response message :
POST https://company/rest/api/2/issue/FTMS-1457/transitions?expand=transitions.fields returned a response status of 204 No Content
Fix Version Query :
I have tried to update fixVersions after removing array but it is showing below error message. Please correct me if it is anything wrong in syntax.
curl -D- -u user:f55ZPwga3cWDBWSAb135VhD16B -H "Content-Type: application/json" --data '{"update":{"fixVersions": {"set": {"name": "Autom"}}}}' -X PUT https://company.atlassian.net/rest/api/2/issue/FTMS-1419
HTTP/1.1 400
Server: AtlassianProxy/1.15.8.1
Cache-Control: no-cache, no-store, no-transform
Content-Type: application/json;charset=UTF-8
Strict-Transport-Security: max-age=315360000; includeSubDomains; preload
Date: Fri, 26 Jul 2019 07:14:37 GMT
ATL-TraceId: 43c87f57c99aab35
X-AACCOUNTID: 5c90c7ef2a28712decf8ac755433
X-AREQUESTID: a764e3c2-a646-4642-8cd7-3f116eca9887634db
X-XSS-Protection: 1; mode=block
Transfer-Encoding: chunked
Timing-Allow-Origin: *
X-Content-Type-Options: nosniff
Connection: close
Set-Cookie: atlassian.xsrf.token=BKA2-A1P7-HQV6-K032_43e3a04e888395979876548f907ada30033e58c2f68368d16_lin; Path=/; Secure
{"errorMessages":["Can not deserialize instance of java.util.ArrayList out of START_OBJECT token\n at [Source: org.apache.catalina.connector.CoyoteInputStream@294c22d; line: 1, column: 12] (through reference chain: com.atlassian.jira.rest.v2.issue.IssueUpdateBean[\"update\"])"]}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
A 204 means the server processed your post, but sent nothing back. No error, but no confirmation either, which doesn't sound right to me. Did your issue go through the transition with the data you added/updated ok?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Nic Brough -Adaptavist- Thanks for your reply.
I have tried to update JIRA status in 2 ways (CURL & HTTP Client). CURL is not showing any error message after updating in JIRA Status (Pass / Fail) but http client is showing 202 error message while updating JIRA status. Status is changed successfully using both methods. The below code is working fine and it is showing 202 response code. Please correct me if it anything wrong in the syntax?
Client client = Client.create();
client.addFilter(new HTTPBasicAuthFilter(JIRA_USERNAME, JIRA_API_TOKEN));
String input = "{\"transition\":{\"id\":\"" + jiraTransitionId + "\"}}".trim();
WebResource webResource = client.resource(JIRA_URL + "/rest/api/2/issue/"+issueKey+"/transitions?expand=transitions.fields");
ClientResponse response = webResource.type("application/json").post(ClientResponse.class, input);
String output = response.getEntity(String.class);
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @poovaraj
Try removing the square brackets [ ] from
"add": {
"fixVersions": [
{
"set": {
"name": "testing"
}
}
]
i.e. the fixVersions isn't in an array
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.