Date-time format in the REST API giving error response Operation value must be a string

I am passing the below JOSN with the POST request to create the Jira issue. One of the parameters is the starting date and time.On the JIRA app we have date and time picker for this field.

customfield_10603

In what format this value should be sent out. I tried with 2018-06-17T00:00:00.0+0000. 

JSON sent: 


{
"fields": {
"project":
{
"key": "HOA"
},
"summary": "Test ticket for JIRA_Jenkins integration.",
"customfield_10616":{"value":"Other"},

"description": "Creating of an issue using project keys and issue type names using the REST API",
"customfield_10603": {"value":"2011-07-05T11:05:00.000+0000"},
"issuetype": {"name": "Change Request" },
"customfield_10624": {"value":"Low"},
"customfield_12100": {"value" :"Low"},
"customfield_10625": {"value":"SRE"},
"customfield_10615": {"value":"Routine"}
}
} .

 Error response received:

{
"errorMessages": [],
"errors": {
"customfield_10603": "Operation value must be a string"
}
}

 

1 answer

0 vote

Hi Rohan,

Try removing the {"value:" } portion so it reads like this:

"customfield_10603":"2011-07-05T11:05:00.000+0000",

I used this to get mine working:

{
"fields": {
    "project": {"key":"BSM"},
    "issuetype": {"id": "10004"},
    "summary": "Testing",
    "description": "Creating test",
    "customfield_10202": "2017-08-16T14:21:00.000-0500"
         }
}

You can see an example of how the datetime field should be set in the REST API documentation under the heading Examples of how to set custom field data for other field types.  Search for DateTimeField.

 

Cheers,

Branden

Hey Branden,

Thank you. It worked!!

 

Cheers,

Rohan

Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Julia Dillon
Posted Tuesday in Jira

Tell us how your team runs on Jira!

Hey Atlassian Community! Today we are launching a bunch of customer stories about the amazing work teams, like Dropbox and Twilio, are doing with Jira. You can check out the stories here. The thi...

344 views 1 18
Join discussion

Atlassian User Groups

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

Find a group

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

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you