I’m working with the Python JIRA library and need help with updating flag fields on tickets. My team switched from using a “Roadblock” status to an “Impediment” flag system.
When I try to update the flag field using this code:
JIRAError: JiraError HTTP 400 url
response text = {"errorMessages":[],"errors":{"customfield_12345":"Field 'customfield_12345' cannot be set. It is not on the appropriate screen, or unknown."}}
I understand that flag fields need to be managed through the Kanban board interface, but I can’t figure out how to do this programmatically with the Python wrapper. Has anyone successfully updated flag fields using the Python JIRA library? What’s the correct approach for this?
Been there! Flag fields aren’t actually custom fields even though they look like them. Try using the JIRA client’s raw REST methods instead - something like connection._session.put(f'/rest/api/2/issue/{issue_key}/properties/flags', json={'impediment': True}). You might need to check the network tab when you manually flag something to see the exact endpoint structure your instance uses.
I hit this exact problem six months ago during a similar transition. Flag fields in JIRA aren’t regular custom fields - you can’t update them through the standard fields parameter. They’re handled differently through the flagging endpoint. Skip the update method with fields and use JIRA’s REST API flag endpoints directly. The Python library doesn’t have a method for this, so I made raw requests with the requests library alongside my JIRA connection. You’ll POST to /rest/api/2/issue/{issueKey}/flag with the right payload structure. Check that your user can manage flags on the project - this is usually restricted to certain roles. That field visibility error is misleading. It’s not about screen configuration, it’s about using the wrong API endpoint for flag management.
Flag fields work differently than regular custom fields - I hit this same issue when automating our workflow changes last year. The Python JIRA library doesn’t expose flag operations directly, so you’ll need to use the underlying REST client. Try connection._session.post() with /rest/greenhopper/1.0/xboard/issue/flag.json as the path. Your payload needs the issue key and flag details. You can also use connection._get_json() to hit the Kanban board’s flag API endpoints. Make sure your API token has board management permissions, not just issue editing. That confusing screen configuration error? It’s actually because you’re using the wrong API path - flags need their own endpoints, not the general field update ones.