|
self._jira_fields_map[jira_field["key"].lower()] = jira_field["id"] |
Older versions of JIRA server don't seem to always have this key field here. I ended up just throwing a defensive gate around it to check it if
I just did
# Some fields might not have a 'key' attribute, so check first
if "key" in jira_field:
self._jira_fields_map[jira_field["key"].lower()] = jira_field["id"]
else:
# For fields without 'key', try alternative identifiers
# Use the field ID as a fallback key (common for custom fields)
fallback_key = jira_field["id"].lower()
self._jira_fields_map[fallback_key] = jira_field["id"]
# Also try using sanitized name as key (remove spaces, special chars)
sanitized_name = (
jira_field["name"].lower().replace(" ", "_").replace("-", "_")
)
self._jira_fields_map[sanitized_name] = jira_field["id"]
# logger.debug(f"JIRA field missing 'key' attribute, using fallbacks - ID: {fallback_key}, Name: {sanitized_name}, Original: {jira_field}")
Otherwise the JIRA bridge won't even start since it tries to do some setup when it first starts.
sg-jira-bridge/sg_jira/jira_session.py
Line 100 in 00e4e5f
Older versions of JIRA server don't seem to always have this key field here. I ended up just throwing a defensive gate around it to check it if
I just did
Otherwise the JIRA bridge won't even start since it tries to do some setup when it first starts.