You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you have a Splunk Support contract, creating a support case for your issue may result in faster resolution.
Describe the bug
Calling artifact_update with an artifact_id, cef_field and cef_value fails if the cef_value is 0.
Error is:
Aug 22, 14:10:56 : Error: Encountered an unhandled exception in custom function "artifact_update" for the parameter dictionary at index=0: {'artifact_id': 2, 'cef_data_type': None, 'cef_field': 'total_hits', 'cef_value': 0, 'input_json': None, 'label': None, 'name': None, 'overwrite_tags': None, 'severity': None, 'tags': None}
Traceback (most recent call last):
File "artifact_update", line 149, in cfentry
File "lib3/phantom/decided/playbook_resource_score.py/playbook_resource_score.py", line 126, in _wrapper
File "lib3/phantom/decided/playbook_resource_score.py/playbook_resource_score.py", line 123, in _wrapper
File "artifact_update", line 73, in artifact_update
ValueError: only one of cef_field and cef_value was provided
Expected behavior
You should be able to pass 0 as the cef_value
Screenshots
If applicable, add screenshots to help explain your problem.
App Version:
Community Custom Function artifact_update - SOAR 6.1
Additional context
The check for cef_field and cef_value is using "not", when it should be checking "is None"
Code snippet (lines 68-70) in the community repo
# validate that if cef_field or cef_value is provided, the other is also provided
if (cef_field and **not cef_value**) or (cef_value and not cef_field):
raise ValueError("only one of cef_field and cef_value was provided")
The text was updated successfully, but these errors were encountered:
If you have a Splunk Support contract, creating a support case for your issue may result in faster resolution.
Describe the bug
Calling artifact_update with an artifact_id, cef_field and cef_value fails if the cef_value is 0.
Error is:
Aug 22, 14:10:56 : Error: Encountered an unhandled exception in custom function "artifact_update" for the parameter dictionary at index=0: {'artifact_id': 2, 'cef_data_type': None, 'cef_field': 'total_hits', 'cef_value': 0, 'input_json': None, 'label': None, 'name': None, 'overwrite_tags': None, 'severity': None, 'tags': None}
Traceback (most recent call last):
File "artifact_update", line 149, in cfentry
File "lib3/phantom/decided/playbook_resource_score.py/playbook_resource_score.py", line 126, in _wrapper
File "lib3/phantom/decided/playbook_resource_score.py/playbook_resource_score.py", line 123, in _wrapper
File "artifact_update", line 73, in artifact_update
ValueError: only one of cef_field and cef_value was provided
Expected behavior
You should be able to pass 0 as the cef_value
Screenshots
If applicable, add screenshots to help explain your problem.
App Version:
Community Custom Function artifact_update - SOAR 6.1
Additional context
The check for cef_field and cef_value is using "not", when it should be checking "is None"
Code snippet (lines 68-70) in the community repo
The text was updated successfully, but these errors were encountered: