Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Unable to create Change tickets using JIRA API with customfield 18901

First Last May 16, 2025

Hi Team,

I am trying to create a change ticket using JIRA API with python script. When I am passing the field "Scheduled execution date"(cf 18901), I unable to create one. It throwing me error as below.

"Failed. Status code: 400, Response: {"errorMessages":[],"errors":{"customfield_18901":"Error parsing time: 2025-05-15 2:20"}}"

Could someone please help me with this field which format I should use.

Thank you!!

 

2 answers

2 accepted

0 votes
Answer accepted
Tuncay Senturk _Snapbytes_
Community Champion
May 16, 2025

Hi @First Last 

Jira expects the correct time format, including the seconds and milliseconds, even if optional in the UI.

so you have to change 

"customfield_18901": "2025-05-17T15:56:03"

to 

"customfield_18901": "2025-05-17T15:56:03.000"

or if you're dynamically formatting the value in Python, something like the below:

scheduled_date = datetime(2025, 5, 17, 15, 56, 3)
formatted_date = scheduled_date.strftime("%Y-%m-%dT%H:%M:%S.000")

if the field is a Date (not DateTime) in that case you'd just use 2025-05-17

First Last May 16, 2025

Thanks for the suggestion,

Could you please help me with this field as well.
"customfiled_10400": {"value": "Myname"}
"customfiled_10400": "Myname"

I tried in both ways but it did not helped me. Please help me with this as well.

The field is for "RM Coordinator"

Tuncay Senturk _Snapbytes_
Community Champion
May 16, 2025

What's the type of that field?

First Last May 16, 2025

Its a string

Tuncay Senturk _Snapbytes_
Community Champion
May 16, 2025

then "customfiled_10400": "Myname" should work.

0 votes
Answer accepted
Nikola Perisic
Community Champion
May 16, 2025

Welcome @First Last 

For this custom field what is the content of the body for this request? Which endpoint are you using?

First Last May 16, 2025

"fields": {
"project": {"key": "CHGMGMT"},
"summary": "Test",
"description": "Test",
"issuetype": {"name": "Operations Change Request"},
"customfield_21901": {"value": "Risk = 1, Impact = 1"}, ##risk and impactlevels
"customfield_29200": {"value": "Infrastructure"}, ##servicezone
"customfield_11902": {"value": "After Business Hours"}, ##Deploymentwindow
"customfield_16002": {"value": "production"}, ##Environment
"customfield_31801": {"value": "Test"}, ## service registry component
"duedate": "2025-05-15",
"customfield_18901": "2025-05-17T15:56:03", #Scheduled-Execution
"customfield_17000": "Test",
"customfield_15000": "Test",
"customfield_12604": "NA",
"customfield_16600": "Test",
#"customfiled_10400": "Test"
}

Using the rest API:
https://atlassian.spscommerce.com/rest/api/2/issue/


customfield_18901 defines Scheduled execution date/time

Nikola Perisic
Community Champion
May 16, 2025

Try using a format like this: "customfield_20000": "06/Jul/19 3:25 PM"

Replace this ID with your custom field ID.

First Last May 16, 2025

Sure, will use this format
Could you please help me with this field as well.
"customfiled_10400": {"value": "Myname"}
"customfiled_10400": "Myname"

I tried in both ways but it did not helped me. Please help me with this as well.

Thank you!!

Nikola Perisic
Community Champion
May 16, 2025

Hi @First Last 

What is the type of that custom field? Pragraph, radio button, multi select, single select, etc?

For this, try with this format:

"customfield_10400": { "content": [ { "content": [ { "text": "My name" } ]

Suggest an answer

Log in or Sign up to answer