I’m trying to build a Python script that automatically creates issue tickets in our system. Our project uses several custom fields and I keep running into problems when trying to set their values through the API.
One specific custom field I’m working with is customfield_15400. This field should have a default setting of “NO” but whenever I try to create an issue, I get this error message:
response text = {"errorMessages":[],"errors":{"customfield_15400":"Could not find valid 'id' or 'value' in the Parent Option object."}}
Here’s the code I’m using:
project_mapping = {'Alpha':'PA', 'Beta':'PB'}
epic_mapping = {'Alpha':'PA-205', 'Beta':'PB-4567'}
for idx, record in ticket_data.iterrows():
new_issue = jira_client.create_issue(
project=project_mapping[record['System']],
summary="[AUTO] Test Issue for '%s' in '%s'" % (record['Action Type'], record['Page Title']),
issuetype={'name':'Bug'},
customfield_15400="No"
)
I’ve looked through documentation and forums but can’t find a clear explanation of how to properly format custom field values. What am I doing wrong here?
The error message indicates that your custom field is configured as a select list or similar option-based field type, not a simple text field. When working with these fields, you need to inspect the field configuration first to understand the expected format. I encountered this same issue in a previous project. You can retrieve the field metadata using jira_client.fields() and look for your specific custom field to see what options are available. Most likely you’ll need to use either the option ID or match the exact case-sensitive value. Try changing your field value to customfield_15400={'value': 'NO'} (note the uppercase) since you mentioned the default should be “NO”. If that doesn’t work, you might need to find the actual option ID through the field metadata and use {'id': 'option_id'} instead.
check if that custom field expects an object instead of just a string value. try using customfield_15400={'value': 'No'} or maybe {'id': 'some_id'} - sounds like its looking for a structured object not plain text
Looking at your error, the custom field is definitely expecting a more complex object structure. What worked for me in similar situations was using the JIRA REST API browser (usually at your-jira-url/rest/api/2/issue/createmeta) to examine the exact format required for that specific custom field. You can also try fetching an existing issue that has this field populated and inspect how the value is structured in the response. Based on the Parent Option reference in your error, this might be a cascading select field where you need to specify both parent and child values. Try something like customfield_15400={'value': 'NO', 'child': {'value': 'some_child_option'}} if it’s cascading, or just verify the exact capitalization and format by examining existing issues first.