def _create_issue_entity(self, issue_data, project):
        """Transform raw issue data into a JiraIssueEntity."""
        fields = issue_data.get("fields", {})
        issue_key = issue_data.get("key", "unknown")

        # Safely get issue type name
        issue_type = fields.get("issuetype", {})
        issue_type_name = issue_type.get("name") if issue_type else None

        # Safely get status name
        status = fields.get("status", {})
        status_name = status.get("name") if status else None

        # Handle Atlassian Document Format (ADF) for description
        description = fields.get("description")
        description_text = None
        if description:
            if isinstance(description, dict):
                # Extract plain text from the ADF structure
                logger.debug(f"Converting ADF description to text for issue {issue_key}")
                description_text = self._extract_text_from_adf(description)
            else:
                description_text = description

        logger.debug(
            f"Creating issue entity: {issue_key} - Type: {issue_type_name}, Status: {status_name}"
        )

        # Use a composite ID format that includes the entity type for uniqueness
        entity_id = f"issue-{issue_data['id']}"

        return JiraIssueEntity(
            entity_id=entity_id,  # Modified to use unique ID
            breadcrumbs=[
                Breadcrumb(entity_id=project.entity_id, name=project.name or "", type="project")
            ],
            issue_key=issue_key,
            summary=fields.get("summary"),
            description=description_text,
            status=status_name,
            issue_type=issue_type_name,
            created_at=fields.get("created"),
            updated_at=fields.get("updated"),
        )
Transform raw issue data into a JiraIssueEntity.
backend/airweave/platform/sources/jira.py