@@ -174,22 +174,28 @@ def __init__(
174174 self ._parent = parent
175175 self ._team_id = team_id
176176 self ._project_id = project_id
177+ self ._context = {"team_id" : self ._team_id , "project_id" : self ._project_id }
177178
178179 def _handle_custom_field_key (self , key ) -> Tuple [str , str , Optional [str ]]:
179- context = {"team_id" : self ._team_id , "project_id" : self ._project_id }
180180 for custom_field in sorted (
181181 self ._service_provider .list_custom_field_names (
182- context , self ._entity , parent = self ._parent
182+ self . _context , self ._entity , parent = self ._parent
183183 ),
184184 key = len ,
185185 reverse = True ,
186186 ):
187187 if custom_field in key :
188188 custom_field_id = self ._service_provider .get_custom_field_id (
189- context , custom_field , entity = self ._entity , parent = self ._parent
189+ self ._context ,
190+ custom_field ,
191+ entity = self ._entity ,
192+ parent = self ._parent ,
190193 )
191194 component_id = self ._service_provider .get_custom_field_component_id (
192- custom_field_id , entity = self ._entity , parent = self ._parent
195+ self ._context ,
196+ custom_field_id ,
197+ entity = self ._entity ,
198+ parent = self ._parent ,
193199 )
194200 key = key .replace (
195201 custom_field ,
@@ -230,7 +236,10 @@ def _determine_condition_and_key(keys: List[str]) -> Tuple[OperatorEnum, str]:
230236 def _handle_special_fields (self , keys : List [str ], val ):
231237 if keys [0 ] == "custom_field" :
232238 component_id = self ._service_provider .get_custom_field_component_id (
233- field_id = int (keys [1 ]), entity = self ._entity , parent = self ._parent
239+ self ._context ,
240+ field_id = int (keys [1 ]),
241+ entity = self ._entity ,
242+ parent = self ._parent ,
234243 )
235244 if component_id == CustomFieldType .DATE_PICKER .value and val is not None :
236245 try :
0 commit comments