From b6ae0ae90223a735c36fd01099e0b4465e24a682 Mon Sep 17 00:00:00 2001 From: Paul Osinski Date: Wed, 11 Mar 2026 15:41:22 -0400 Subject: [PATCH] load jira custom_fields as json --- dojo/api_v2/serializers.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/dojo/api_v2/serializers.py b/dojo/api_v2/serializers.py index e4e67a8dac5..b7de19547d0 100644 --- a/dojo/api_v2/serializers.py +++ b/dojo/api_v2/serializers.py @@ -1428,6 +1428,12 @@ def validate(self, data): msg = "Either engagement or product has to be set." raise serializers.ValidationError(msg) + if "custom_fields" in data and isinstance(data["custom_fields"], str): + try: + data["custom_fields"] = json.loads(data["custom_fields"]) + except json.JSONDecodeError as e: + raise serializers.ValidationError({"custom_fields": f"Invalid JSON: {e}"}) from e + return data