Not able to create issue with description field. Below is my request
{
"fields": {
"project": {
"key": "SR"
},
"issuetype": {
"name": "Bug"
},
"customfield_10900": {
"value": "Blocker"
},
"customfield_11308": "test@mail.com",
"customfield_11309": "User1",
"customfield_11310": "8563236563",
"summary": "Create Defect",
"description": "Create Description"
}
}
Following request works but the value sent is not getting reflected in JIRA
{
"fields": {
"project": {
"key": "SR"
},
"issuetype": {
"name": "Bug"
},
"customfield_10900": {
"value": "Blocker"
},
"customfield_11308": "aanand.dhandapani@cognizant.com",
"customfield_11309": "User1",
"customfield_11310": "8563236563",
"summary": "asdasdasda",
"description": ["value","Test"],
"customfield_11311": "asdasdasdasd"
}
}
Hello,
This line
"description": ["value","Test"],
means that you are sending an array. It has no meaning for the description field.
I just had a look at Jira Cloud Doc and description is set like this:
"description": { "type": "doc", "version": 1, "content": [ { "type": "paragraph", "content": [ { "type": "text", "text": "description" } ] } ] },
You can have a look here:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You are welcome!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi there,
just to avoid further pitfalls: please be aware in the above example the last character is an colon "," so the JSON data would expect an additional line!
In case it is the last information you sent remove it !
Below example with Postman to create a issue:
Please be aware there are differences in API version 2 vs 3, this example is on V3!
POST https://<Jira-Cloud-instance>/rest/api/3/issue
Basic: please be aware in Postman you need your username (usually Email address) and your API code (not the encrypted which you need e.g. using Python!)
Accept: application/json
Content-Type:application/json
configured as Raw and JSON format:
{
"fields": {
"project": {
"id": "<ProjectID>"
},
"issuetype": {
"id": "<IssueTypeID>"
},
"summary": "created via Postman.",
"description": {
"type": "doc",
"version": 1,
"content": [
{
"type": "paragraph",
"content": [
{
"type": "text",
"text": "description"
}
]
}
]
}
}
}
Top-Level node type is set to paragraph here (see ) - even if I don´t know yet where it is documented that the standard description field is a paragraph ;)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
It seems that JIRA API v2 defaults to string data type, v3 does not.
v2 will accept the following as a string.
fields: {
"somefield": "somevalue"
}
v3 of the API will reject with the "Operation value must be an object".
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I'm having a similar issue on cloud. I have a text field custom field that gives me the same response.
{
"fields": {
"issuetype": {
"id": "10018",
"name": "Problem"
},
"project": {
"id": "10155",
"key": "SERVDEMO"
},
"summary": "Testing Problem from API",
"priority": {
"id": "10000"
},
"description": {
"version": 1,
"type": "doc",
"content": [
{
"type": "paragraph",
"content": [
{
"type": "text",
"text": "Testing Description"
}]
}]
},
"customfield_10031": "Stuff",
"customfield_10046": {
"name": "jira-software-users"
}
}
}
I get the following response:
{
"errorMessages": [],
"errors": {
"customfield_10031": "Operation value must be an object"
}
}
If I change my body to be:
"customfield_10031": {"value": "Stuff"},
Then my ticket has a value:
Any help would be great. Thanks.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Tim, I've figured, there is a bug in API v3, so if you switch to v2, you will be fine.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Alexander, there is any information about this bug?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Is there an open issue about that?
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.
Hi @Aanand D ,
First script should work.
Could you please share what is exact response error code?
below is the standard format.
{ "fields": { "project": { "key": "TEST" }, "summary": "REST ye merry gentlemen.", "description": "Creating of an issue using project keys and issue type names using the REST API", "issuetype": { "name": "Bug" } } }
First try with above JSON input data then try to add custom fields related data.
Thanks,
Prashant
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
A lot of this depends on the "type" of field you are setting.
For ex, a people picker type such as assignee needs an "ID" even though on a data entry screen it accepts text as typed.
So something like this would work:
{
"fields": { "assignee": { "id": {{initiator.accountId.asJsonString}} } }
}
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.