Invalid custom field "custom_field" on valid custom field

Get help from other users here.

Moderators: Developer, Contributor

Post Reply
acoder2020
Posts: 65
Joined: 11 Jan 2024, 19:32

Invalid custom field "custom_field" on valid custom field

Post by acoder2020 »

I'm getting this error suddenly:

Code: Select all

Bad request (HTTP Code 400). Check your JSON data:
Response:

{"message":"Invalid custom field 'affects_security' value.","code":1303,"localized":"Invalid value for field \"affects_security\"."}
Here's the JSON snippet:

Code: Select all

	$custom_affects_security = '1';
	$custom_trac_ticket_id = '1234';

...

	    'custom_fields' => [
	        [
	            'field' => ['id' => 1],  // ID of the custom field for trac_ticket_id
	            'value' => $custom_trac_ticket_id
	        ],
	        [
	            'field' => ['id' => 2],  // ID of the custom field for affects_security
	            'value' => $custom_affects_security
	        ]
	    ],
What could be causing this?
atrol
Site Admin
Posts: 8378
Joined: 26 Mar 2008, 21:37
Location: Germany

Re: Invalid custom field "custom_field" on valid custom field

Post by atrol »

Hard to tell something without knowing the definition of "affects_security".
Does it work if you don't set "affects_security"?
Please use Search before posting and read the Manual
acoder2020
Posts: 65
Joined: 11 Jan 2024, 19:32

Re: Invalid custom field "custom_field" on valid custom field

Post by acoder2020 »

Got it sorted, I had a bug where my dates were being converted twice :oops:

Custom fields are being added perfectly now.
Post Reply