Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Deleted user
0 / 0 points
Next:
badges earned

Your Points Tracker
Challenges
Leaderboard
  • Global
  • Feed

Badge for your thoughts?

You're enrolled in our new beta rewards program. Join our group to get the inside scoop and share your feedback.

Join group
Recognition
Give the gift of kudos
You have 0 kudos available to give
Who do you want to recognize?
Why do you want to recognize them?
Kudos
Great job appreciating your peers!
Check back soon to give more kudos.

Past Kudos Given
No kudos given
You haven't given any kudos yet. Share the love above and you'll see it here.

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Operation value must be an object from issue create for description field

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"
}
}

4 answers

1 accepted

5 votes
Answer accepted

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:

https://developer.atlassian.com/cloud/jira/platform/rest/v3/?utm_source=%2Fcloud%2Fjira%2Fplatform%2Frest%2F&utm_medium=302#api-api-3-issue-post

Like # people like this

This worked. Thanks a lot.

You are welcome!

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

Postman settings

Authentication:

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!)

Headers: 

Accept: application/json

Content-Type:application/json

Body:

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 ;) 

 

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:

image.pngAny help would be great. Thanks.

Tim, I've figured, there is a bug in API v3, so if you switch to v2, you will be fine.

Alexander, there is any information about this bug?

Is there an open issue about that?

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".

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

This is the response I get

{
"errorMessages": [],
"errors": {
"description": "Operation value must be an object"
}
}

Suggest an answer

Log in or Sign up to answer
TAGS

Community Events

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

Find an event

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

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you