diff --git a/jira/client.py b/jira/client.py index ff311bcd6..ad16ba98b 100644 --- a/jira/client.py +++ b/jira/client.py @@ -672,6 +672,16 @@ def __init__( JIRA.checked_version = True self._fields_cache_value: dict[str, str] = {} # access via self._fields_cache + self._fields_cache_value_raw: list[ + dict[str, Any] + ] = [] # access via self._fields_cache_raw + + @property + def _fields_cache_raw(self) -> list[dict[str, Any]]: + """Cached raw dictionary of of /field endpoint. Lazy loaded.""" + if not self._fields_cache_value_raw: + self._fields_cache_value_raw = self.fields() + return self._fields_cache_value_raw @property def _fields_cache(self) -> dict[str, str]: @@ -683,7 +693,7 @@ def _fields_cache(self) -> dict[str, str]: def _update_fields_cache(self): """Update the cache used for `self._fields_cache`.""" self._fields_cache_value = {} - for f in self.fields(): + for f in self._fields_cache_raw: if "clauseNames" in f: for name in f["clauseNames"]: self._fields_cache_value[name] = f["id"]