Hi community,
I try to create an Jira issue via
"/rest/api/3/issue"
with payload:
{
"fields" : {
"project" : {
"key" : "ABCD",
"id" : 10463
},
"issuetype" : {
"id" : "10037"
},
"summary" : "Connector generierte UserStory"
}
}
Unfortunately I always get "Geben Sie eine gültige Projekt-ID oder einen gültigen Schlüssel an"
When I try the same payload in RESTman with the same auth token the issue is successfully created.
The project id matches the project key. I checked it via the /project/search REST endpoint.
In RESTman I used the same auth token like in my Java application. Reading issues and projects works. Only creating issues doesn't.
I also tried to proivide only project id or key. Same result.
Any hints?
Found the answer in this post: https://community.developer.atlassian.com/t/java-unirest-client-jira-cloud-api/49877/6
The API documentation is wrong!
HttpResponse<JsonNode> response = Unirest.post("https://your-domain.atlassian.net/rest/api/3/issue")
.basicAuth("email@example.com", "<api_token>")
.header("Accept", "application/json")
.header("Content-Type", "application/json")
.body(payload)
.asJson();It needs to be:
HttpResponse<JsonNode> response = Unirest.post("https://your-domain.atlassian.net/rest/api/3/issue")
.basicAuth("email@example.com", "<api_token>")
.header("Accept", "application/json")
.header("Content-Type", "application/json")
.body(payload.toString())
.asJson();
Thanks for reporting this inconsistency! I am passing over your feedback and request to update the documentation. Appropriate team will work on it according to their workflows and prioritization.
Best,
Anastasiia
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello @Schmidt_ Paul
I flagged this post for Atlassian, so someone can forward it to the respective team for documentation review.
Glad you can solve it :)
Best,
Arkadiusz🤠
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.