Skip to content

Commit e039b0b

Browse files
authored
load jira custom_fields as json (#14494)
1 parent 376d0fe commit e039b0b

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

dojo/api_v2/serializers.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1428,6 +1428,12 @@ def validate(self, data):
14281428
msg = "Either engagement or product has to be set."
14291429
raise serializers.ValidationError(msg)
14301430

1431+
if "custom_fields" in data and isinstance(data["custom_fields"], str):
1432+
try:
1433+
data["custom_fields"] = json.loads(data["custom_fields"])
1434+
except json.JSONDecodeError as e:
1435+
raise serializers.ValidationError({"custom_fields": f"Invalid JSON: {e}"}) from e
1436+
14311437
return data
14321438

14331439

0 commit comments

Comments
 (0)