4 / 8
Mar 6

Hi everyone,
I am having a problem with creating a parent Infolog and child Infologs.

  • I have attached an email to a group to create with Infolog but there is a problem that it does not work with the group email.

  • When I create the parent Infolog, it has a UID but creating subs by UID is completely impossible to attach.
     def create_task_on_egroupware(request, title, egroupware_group_id, description, parent_uid=None):

        API_URL = settings.EGROUPWARE_API_URL
        username = request.user.username
        password = settings.EGROUPWARE_CREDENTIALS.get('password')

        api_url = f"{API_URL}/{username}/infolog/"

        headers = {
            "Content-Type": "application/json",
            "Prefer": "return=representation",
            "Accept": "application/pretty+json"
        }

        # 🔹 Lấy thời gian hiện tại theo chuẩn UTC, định dạng ISO 8601
        start_time = datetime.now(timezone.utc).isoformat()

        # 🔹 Lấy thông tin nhóm từ ExtendedGroup dựa vào egroupware_group_id
        try:
            group = ExtendedGroup.objects.get(egroupware_group_id=egroupware_group_id)
            group_name = group.group.name  # Lấy tên group
            group_email = group.email_manager  # Lấy email manager
            group_principal_url = f"principals/groups/{group_name.lower()}/"  # Dùng principal-URL
        except ExtendedGroup.DoesNotExist:
            print(f"❌ Group not found for egroupware_group_id = {egroupware_group_id}")
            return None

        # 🔹 Định nghĩa payload
        payload = {
            "title": title,
            "start": start_time,  # Thời gian tạo task
            "timeZone": "Europe/Warsaw",  # Múi giờ
            "description": description,  # Mô tả task
            "priority": 5,  # Độ ưu tiên mặc định
            "participants": [
                {
                    "@type": "Participant",
                    "name": group_name,
                    "uri": group_principal_url,  # 🟢 Dùng principal-URL thay vì email
                    "email": group_email,
                    "kind": "group",
                    "roles": {"attendee": True}
                }
            ],
            "status": "confirmed",
            "progress": "needs-action",
        }

        # Nếu có nhiệm vụ cha, thêm `relatedTo` đúng định dạng
        if parent_uid:
            payload["relatedTo"] = {
                parent_uid: {
                    "@type": "Relation",
                    "relation": "parent"
                }
            }

        print(f"🔹 Sending request to EGroupware: {json.dumps(payload, indent=2)}")

        # 🔹 Gửi request lên EGroupware
        response = requests.post(api_url, auth=(username, password), headers=headers, json=payload)

        print(f"🔹 Response status: {response.status_code}")
        print(f"🔹 Response text: {response.text}")

        # 🔹 Xử lý lỗi JSONDecodeError nếu phản hồi rỗng
        if response.status_code == 201:
            try:
                result = response.json()
                return result.get("uid", None)  # Trả về UID của task vừa tạo
            except json.JSONDecodeError:
                print(f"⚠️ JSONDecodeError but task created successfully.")
                return "Task Created (No JSON Response)"  # Giả lập UID

        else:
            print(f"⚠️ Error creating task: {response.text}")
            return None

     def wait_for_task_creation(api_url, auth, task_uid, headers, max_retries=10, wait_time=5):

        for i in range(max_retries):
            print(f"⏳ Check if parent task exists... Attempt {i+1}/{max_retries}")

            response = requests.get(api_url, auth=auth, headers=headers)

            if response.status_code == 200:
                try:
                    tasks = response.json().get("responses", {})

                    # Kiểm tra nếu task cha đã xuất hiện
                    for task_url, task in tasks.items():
                        if task.get("uid") == task_uid:
                            print(f"✅ Task parent {task_uid} exists in EGroupware!")
                            return True  

                    # 🔹 Nếu chưa tìm thấy, thử tìm theo title
                    print("⚠️ Task parent {task_uid} not found, searching by title...")
                    title_search_url = f"{api_url}?filter[title]=Room 101"
                    search_response = requests.get(title_search_url, auth=auth, headers=headers)
                    
                    if search_response.status_code == 200:
                        task_data = search_response.json().get("responses", {})
                        for task_url, task in task_data.items():
                            if task.get("title") == f"Room {room_number}":
                                found_uid = task.get("uid")
                                print(f"✅ Task parent {found_uid} exists in EGroupware!")
                                return found_uid  # Trả về UID mới

                except json.JSONDecodeError:
                    print("⚠️ JSONDecodeError - Response is not valid JSON. Try again...")

            time.sleep(wait_time)

        print(f"❌ Task parent {task_uid} does not exist after {max_retries} retries!")
        return False

     def create_checkout_room_task(request, room_number):

        extended_group = get_object_or_404(ExtendedGroup, group__name="housekeeping")
        egroupware_group_id = extended_group.egroupware_group_id

        # Tạo Task cha
        parent_uid = create_task_on_egroupware(
            request,
            title=f"Room {room_number}",
            egroupware_group_id=egroupware_group_id,
            description=f"Room {room_number}"
        )

        if not parent_uid:
            return "❌ Error creating Task Room on EGroupware!"

        # Chờ task cha xuất hiện trước khi tạo sub-task
        API_URL = settings.EGROUPWARE_API_URL
        username = request.user.username
        password = settings.EGROUPWARE_CREDENTIALS.get('password')
        headers = {"Accept": "application/pretty+json"}

        if not wait_for_task_creation(f"{API_URL}/{username}/infolog/", auth=(username, password), task_uid=parent_uid, headers=headers):
            print(f"⚠️ The parent task {parent_uid} does not exist. Try retrieving the task list from the EGroupware API...")

            response = requests.get(f"{API_URL}/{username}/infolog/?filter[title]=Room {room_number}", auth=(username, password), headers=headers)
            if response.status_code == 200:
                try:
                    task_data = response.json().get("responses", {})
                    for task_url, task in task_data.items():
                        if task.get("title") == f"Room {room_number}":
                            parent_uid = task.get("uid")
                            print(f"✅ Found parent task again: {parent_uid}")
                            break
                except json.JSONDecodeError:
                    print(f"❌ JSONDecodeError - Response is not valid JSON. Try again...")

        if not parent_uid:
            return f"❌ The parent task {parent_uid} has not yet been recorded in the system.!"

        # Lấy danh sách sub-task từ TaskTemplate
        sub_tasks = TaskTemplate.objects.filter(task_type="Cleaning vacant rooms")

        for task in sub_tasks:
            subtask_description = f"""
            Task Parent: Room {room_number}
            Area: {task.area}
            Task: {task.name}
            """

            create_task_on_egroupware(
                request,
                title=f"Room {room_number}: {task.name}",
                egroupware_group_id=egroupware_group_id,
                description=subtask_description.strip(),
                parent_uid=parent_uid
            )

        return f"✅ Task Room {room_number} and sub-tasks have been created on EGroupware!"

:small_blue_diamond: Sending request to EGroupware: {
“title”: “Room 101”,
“start”: “2025-03-05T12:05:22.232169+00:00”,
“timeZone”: “Europe/Warsaw”,
“description”: “Room 101”,
“priority”: 5,
“participants”: [
{
"@type": “Participant”,
“name”: “housekeeping”,
“uri”: “principals/groups/housekeeping/”,
“email”: "-1008@lists.egroupware.org",
“kind”: “group”,
“roles”: {
“attendee”: true
}
}
],
“status”: “confirmed”,
“progress”: “needs-action”
}
:small_blue_diamond: Response status: 201
:small_blue_diamond: Response text: {
"@type": “Task”,
“prodId”: “EGroupware InfoLog 23.1.011”,
“uid”: “urn:uuid:f8e4616e-22b3-43f2-8d82-30c69ff10ca5”,
“created”: “2025-03-05T12:05:22Z”,
“title”: “Room 101”,
“start”: “2025-03-05T13:05:22”,
“timeZone”: “Europe/Warsaw”,
“description”: “Room 101”,
“participants”: {
“1067”: {
"@type": “Participant”,
“name”: “Tuan Nguyen Le”,
“email”: "ngletuan94@gmail.com",
“kind”: “individual”,
“roles”: { “owner”: true }
},
“housekeeping -1008@lists.egroupware.org”: {
"@type": “Participant”,
“name”: “housekeeping”,
“email”: "-1008@lists.egroupware.org",
“kind”: “individual”,
“roles”: { “informational”: true }
}
},
“status”: “confirmed”,
“progress”: “needs-action”,
“priority”: 9,
“privacy”: “public”,
egroupware.org:type”: “task”
}
:hourglass_flowing_sand: Check if parent task exists… Attempt 1/10
:white_check_mark: Task parent urn:uuid:f8e4616e-22b3-43f2-8d82-30c69ff10ca5 exists in EGroupware!
:small_blue_diamond: Sending request to EGroupware: {
“title”: “Room 101: Change bed linens and sheets”,
“start”: “2025-03-05T12:05:22.470393+00:00”,
“timeZone”: “Europe/Warsaw”,
“description”: “Task Parent: Room 101\n Area: Hotel\n Task: Change bed linens and sheets”,
“priority”: 5,
“participants”: [
{
"@type": “Participant”,
“name”: “housekeeping”,
“uri”: “principals/groups/housekeeping/”,
“email”: "-1008@lists.egroupware.org",
“kind”: “group”,
“roles”: {
“attendee”: true
}
}
],
“status”: “confirmed”,
“progress”: “needs-action”,
“relatedTo”: {
“urn:uuid:f8e4616e-22b3-43f2-8d82-30c69ff10ca5”: {
"@type": “Relation”,
“relation”: “parent”
}
}
}
:small_blue_diamond: Response status: 422
:small_blue_diamond: Response text: {
“error”: 422,
“message”: “Error parsing JsTask attribute ‘relatedTo’: UID ‘urn:uuid:f8e4616e-22b3-43f2-8d82-30c69ff10ca5’ NOT found!”
}
:warning:️ Error creating task: {
“error”: 422,
“message”: “Error parsing JsTask attribute ‘relatedTo’: UID ‘urn:uuid:f8e4616e-22b3-43f2-8d82-30c69ff10ca5’ NOT found!”
}
:small_blue_diamond: Sending request to EGroupware: {
“title”: “Room 101: Vacuum the entire room and bathroom”,
“start”: “2025-03-05T12:05:22.541383+00:00”,
“timeZone”: “Europe/Warsaw”,
“description”: “Task Parent: Room 101\n Area: Hotel\n Task: Vacuum the entire room and bathroom”,
“priority”: 5,
“participants”: [
{
"@type": “Participant”,
“name”: “housekeeping”,
“uri”: “principals/groups/housekeeping/”,
“email”: "-1008@lists.egroupware.org",
“kind”: “group”,
“roles”: {
“attendee”: true
}
}
],
“status”: “confirmed”,
“progress”: “needs-action”,
“relatedTo”: {
“urn:uuid:f8e4616e-22b3-43f2-8d82-30c69ff10ca5”: {
"@type": “Relation”,
“relation”: “parent”
}
}
}
:small_blue_diamond: Response status: 422
:small_blue_diamond: Response text: {
“error”: 422,
“message”: “Error parsing JsTask attribute ‘relatedTo’: UID ‘urn:uuid:f8e4616e-22b3-43f2-8d82-30c69ff10ca5’ NOT found!”
}
:warning:️ Error creating task: {
“error”: 422,
“message”: “Error parsing JsTask attribute ‘relatedTo’: UID ‘urn:uuid:f8e4616e-22b3-43f2-8d82-30c69ff10ca5’ NOT found!”
}
:small_blue_diamond: Sending request to EGroupware: {
“title”: “Room 101: Dust the desk, wardrobe, doors, windowsills, lamps”,
“start”: “2025-03-05T12:05:22.610553+00:00”,
“timeZone”: “Europe/Warsaw”,
“description”: “Task Parent: Room 101\n Area: Hotel\n Task: Dust the desk, wardrobe, doors, windowsills, lamps”,
“priority”: 5,
“participants”: [
{
"@type": “Participant”,
“name”: “housekeeping”,
“uri”: “principals/groups/housekeeping/”,
“email”: "-1008@lists.egroupware.org",
“kind”: “group”,
“roles”: {
“attendee”: true
}
}
],
“status”: “confirmed”,
“progress”: “needs-action”,
“relatedTo”: {
“urn:uuid:f8e4616e-22b3-43f2-8d82-30c69ff10ca5”: {
"@type": “Relation”,
“relation”: “parent”
}
}
}
:small_blue_diamond: Response status: 422
:small_blue_diamond: Response text: {
“error”: 422,
“message”: “Error parsing JsTask attribute ‘relatedTo’: UID ‘urn:uuid:f8e4616e-22b3-43f2-8d82-30c69ff10ca5’ NOT found!”
}
:warning:️ Error creating task: {
“error”: 422,
“message”: “Error parsing JsTask attribute ‘relatedTo’: UID ‘urn:uuid:f8e4616e-22b3-43f2-8d82-30c69ff10ca5’ NOT found!”
}
:small_blue_diamond: Sending request to EGroupware: {
“title”: “Room 101: Clean the kettle and cups”,
“start”: “2025-03-05T12:05:22.682884+00:00”,
“timeZone”: “Europe/Warsaw”,
“description”: “Task Parent: Room 101\n Area: Hotel\n Task: Clean the kettle and cups”,
“priority”: 5,
“participants”: [
{
"@type": “Participant”,
“name”: “housekeeping”,
“uri”: “principals/groups/housekeeping/”,
“email”: "-1008@lists.egroupware.org",
“kind”: “group”,
“roles”: {
“attendee”: true
}
}
],
“status”: “confirmed”,
“progress”: “needs-action”,
“relatedTo”: {
“urn:uuid:f8e4616e-22b3-43f2-8d82-30c69ff10ca5”: {
"@type": “Relation”,
“relation”: “parent”
}
}
}
:small_blue_diamond: Response status: 422
:small_blue_diamond: Response text: {
“error”: 422,
“message”: “Error parsing JsTask attribute ‘relatedTo’: UID ‘urn:uuid:f8e4616e-22b3-43f2-8d82-30c69ff10ca5’ NOT found!”
}
:warning:️ Error creating task: {
“error”: 422,
“message”: “Error parsing JsTask attribute ‘relatedTo’: UID ‘urn:uuid:f8e4616e-22b3-43f2-8d82-30c69ff10ca5’ NOT found!”
}
:small_blue_diamond: Sending request to EGroupware: {
“title”: “Room 101: Refill the coffee and tea set, leave a bottle of water”,
“start”: “2025-03-05T12:05:22.759663+00:00”,
“timeZone”: “Europe/Warsaw”,
“description”: “Task Parent: Room 101\n Area: Hotel\n Task: Refill the coffee and tea set, leave a bottle of water”,
“priority”: 5,
“participants”: [
{
"@type": “Participant”,
“name”: “housekeeping”,
“uri”: “principals/groups/housekeeping/”,
“email”: "-1008@lists.egroupware.org",
“kind”: “group”,
“roles”: {
“attendee”: true
}
}
],
“status”: “confirmed”,
“progress”: “needs-action”,
“relatedTo”: {
“urn:uuid:f8e4616e-22b3-43f2-8d82-30c69ff10ca5”: {
"@type": “Relation”,
“relation”: “parent”
}
}
}
:small_blue_diamond: Response status: 422
:small_blue_diamond: Response text: {
“error”: 422,
“message”: “Error parsing JsTask attribute ‘relatedTo’: UID ‘urn:uuid:f8e4616e-22b3-43f2-8d82-30c69ff10ca5’ NOT found!”
}
:warning:️ Error creating task: {
“error”: 422,
“message”: “Error parsing JsTask attribute ‘relatedTo’: UID ‘urn:uuid:f8e4616e-22b3-43f2-8d82-30c69ff10ca5’ NOT found!”
}
:small_blue_diamond: Sending request to EGroupware: {
“title”: “Room 101: Check the hotel service brochure set, restock if necessary”,
“start”: “2025-03-05T12:05:22.828724+00:00”,
“timeZone”: “Europe/Warsaw”,
“description”: “Task Parent: Room 101\n Area: Hotel\n Task: Check the hotel service brochure set, restock if necessary”,
“priority”: 5,
“participants”: [
{
"@type": “Participant”,
“name”: “housekeeping”,
“uri”: “principals/groups/housekeeping/”,
“email”: "-1008@lists.egroupware.org",
“kind”: “group”,
“roles”: {
“attendee”: true
}
}
],
“status”: “confirmed”,
“progress”: “needs-action”,
“relatedTo”: {
“urn:uuid:f8e4616e-22b3-43f2-8d82-30c69ff10ca5”: {
"@type": “Relation”,
“relation”: “parent”
}
}
}
:small_blue_diamond: Response status: 422
:small_blue_diamond: Response text: {
“error”: 422,
“message”: “Error parsing JsTask attribute ‘relatedTo’: UID ‘urn:uuid:f8e4616e-22b3-43f2-8d82-30c69ff10ca5’ NOT found!”
}
:warning:️ Error creating task: {
“error”: 422,
“message”: “Error parsing JsTask attribute ‘relatedTo’: UID ‘urn:uuid:f8e4616e-22b3-43f2-8d82-30c69ff10ca5’ NOT found!”
}
:small_blue_diamond: Sending request to EGroupware: {
“title”: “Room 101: Clean the ceiling and remove cobwebs”,
“start”: “2025-03-05T12:05:22.893179+00:00”,
“timeZone”: “Europe/Warsaw”,
“description”: “Task Parent: Room 101\n Area: Hotel\n Task: Clean the ceiling and remove cobwebs”,
“priority”: 5,
“participants”: [
{
"@type": “Participant”,
“name”: “housekeeping”,
“uri”: “principals/groups/housekeeping/”,
“email”: "-1008@lists.egroupware.org",
“kind”: “group”,
“roles”: {
“attendee”: true
}
}
],
“status”: “confirmed”,
“progress”: “needs-action”,
“relatedTo”: {
“urn:uuid:f8e4616e-22b3-43f2-8d82-30c69ff10ca5”: {
"@type": “Relation”,
“relation”: “parent”
}
}
}
:small_blue_diamond: Response status: 422
:small_blue_diamond: Response text: {
“error”: 422,
“message”: “Error parsing JsTask attribute ‘relatedTo’: UID ‘urn:uuid:f8e4616e-22b3-43f2-8d82-30c69ff10ca5’ NOT found!”
}
:warning:️ Error creating task: {
“error”: 422,
“message”: “Error parsing JsTask attribute ‘relatedTo’: UID ‘urn:uuid:f8e4616e-22b3-43f2-8d82-30c69ff10ca5’ NOT found!”
}
:small_blue_diamond: Sending request to EGroupware: {
“title”: “Room 101: Clean the fridge, discard any leftover products”,
“start”: “2025-03-05T12:05:22.969534+00:00”,
“timeZone”: “Europe/Warsaw”,
“description”: “Task Parent: Room 101\n Area: Hotel\n Task: Clean the fridge, discard any leftover products”,
“priority”: 5,
“participants”: [
{
"@type": “Participant”,
“name”: “housekeeping”,
“uri”: “principals/groups/housekeeping/”,
“email”: "-1008@lists.egroupware.org",
“kind”: “group”,
“roles”: {
“attendee”: true
}
}
],
“status”: “confirmed”,
“progress”: “needs-action”,
“relatedTo”: {
“urn:uuid:f8e4616e-22b3-43f2-8d82-30c69ff10ca5”: {
"@type": “Relation”,
“relation”: “parent”
}
}
}
:small_blue_diamond: Response status: 422
:small_blue_diamond: Response text: {
“error”: 422,
“message”: “Error parsing JsTask attribute ‘relatedTo’: UID ‘urn:uuid:f8e4616e-22b3-43f2-8d82-30c69ff10ca5’ NOT found!”
}
:warning:️ Error creating task: {
“error”: 422,
“message”: “Error parsing JsTask attribute ‘relatedTo’: UID ‘urn:uuid:f8e4616e-22b3-43f2-8d82-30c69ff10ca5’ NOT found!”
}
:small_blue_diamond: Sending request to EGroupware: {
“title”: “Room 101: Clean windows, frames, and windowsills (both sides)”,
“start”: “2025-03-05T12:05:23.035995+00:00”,
“timeZone”: “Europe/Warsaw”,
“description”: “Task Parent: Room 101\n Area: Hotel\n Task: Clean windows, frames, and windowsills (both sides)”,
“priority”: 5,
“participants”: [
{
"@type": “Participant”,
“name”: “housekeeping”,
“uri”: “principals/groups/housekeeping/”,
“email”: "-1008@lists.egroupware.org",
“kind”: “group”,
“roles”: {
“attendee”: true
}
}
],
“status”: “confirmed”,
“progress”: “needs-action”,
“relatedTo”: {
“urn:uuid:f8e4616e-22b3-43f2-8d82-30c69ff10ca5”: {
"@type": “Relation”,
“relation”: “parent”
}
}
}
:small_blue_diamond: Response status: 422
:small_blue_diamond: Response text: {
“error”: 422,
“message”: “Error parsing JsTask attribute ‘relatedTo’: UID ‘urn:uuid:f8e4616e-22b3-43f2-8d82-30c69ff10ca5’ NOT found!”
}
:warning:️ Error creating task: {
“error”: 422,
“message”: “Error parsing JsTask attribute ‘relatedTo’: UID ‘urn:uuid:f8e4616e-22b3-43f2-8d82-30c69ff10ca5’ NOT found!”
}
:small_blue_diamond: Sending request to EGroupware: {
“title”: “Room 101: Wipe the entrance door to the room and bathroom”,
“start”: “2025-03-05T12:05:23.114756+00:00”,
“timeZone”: “Europe/Warsaw”,
“description”: “Task Parent: Room 101\n Area: Hotel\n Task: Wipe the entrance door to the room and bathroom”,
“priority”: 5,
“participants”: [
{
"@type": “Participant”,
“name”: “housekeeping”,
“uri”: “principals/groups/housekeeping/”,
“email”: "-1008@lists.egroupware.org",
“kind”: “group”,
“roles”: {
“attendee”: true
}
}
],
“status”: “confirmed”,
“progress”: “needs-action”,
“relatedTo”: {
“urn:uuid:f8e4616e-22b3-43f2-8d82-30c69ff10ca5”: {
"@type": “Relation”,
“relation”: “parent”
}
}
}
:small_blue_diamond: Response status: 422
:small_blue_diamond: Response text: {
“error”: 422,
“message”: “Error parsing JsTask attribute ‘relatedTo’: UID ‘urn:uuid:f8e4616e-22b3-43f2-8d82-30c69ff10ca5’ NOT found!”
}
:warning:️ Error creating task: {
“error”: 422,
“message”: “Error parsing JsTask attribute ‘relatedTo’: UID ‘urn:uuid:f8e4616e-22b3-43f2-8d82-30c69ff10ca5’ NOT found!”
}

  • I have tried all ways to fix the error but still not working.

Hi ngletuan,

Using an email address to identify a group is currently NOT working, I need to fix this :frowning:

This is due to the fact that you prefixed the UID with “urn:uuid:”, which is currently not understood, we expects just the UID. I will change the parser to allow an optional prefix of “urn:uuid:”.

Ralf

Good morning Sir,

I am building a separate ERP application, and Egroupware is used to manage the main database. So it will be completely API-based so Infolog or Calendar cannot use UID prefixed with “urn:uuid" or add Group was participants

That is not what I said!

I will fix these bugs, but in the meantime you can work around one of them by removing the prefix “urn:uuid:” from the UID.

Ralf

24 days later

I tried to adjust everything but it still shows the same error even though I also updated Egroupware to the new version

[31/Mar/2025 13:50:45] "GET /api/fetch_tasks/?status=&t=1743421844376 HTTP/1.1" 200 5684
🔹 Sending request to EGroupware: {
  "title": "Room 101",
  "start": "2025-03-31T11:50:48.733782+00:00",
  "timeZone": "Europe/Warsaw",
  "description": "Room 101",
  "priority": 5,
  "participants": [
    {
      "@type": "participant",
      "name": "housekeeping",
      "email": "housekeeping@jesshotel.pl",
      "kind": "group",
      "roles": {
        "attendee": true
      }
    }
  ],
  "status": "confirmed",
  "progress": "needs-action"
}
🔹 Response status: 201
🔹 Response text: {
    "@type": "Task",
    "prodId": "EGroupware InfoLog 23.1.011",
    "uid": "urn:uuid:b8a26c8d-d605-45b0-8e15-cbabb8aa105d",
    "created": "2025-03-31T11:50:48Z",
    "title": "Room 101",
    "start": "2025-03-31T13:50:48",
    "timeZone": "Europe/Warsaw",
    "description": "Room 101",
    "participants": {
        "1067": {
            "@type": "Participant",
            "name": "Tuan Nguyen Le",
            "email": "ngletuan94@gmail.com",
            "kind": "individual",
            "roles": { "owner": true }
        },
        "housekeeping <housekeeping@jesshotel.pl>": {
            "@type": "Participant",
            "name": "housekeeping",
            "email": "housekeeping@jesshotel.pl",
            "kind": "individual",
            "roles": { "informational": true }
        }
    },
    "status": "confirmed",
    "progress": "needs-action",
    "priority": 9,
    "privacy": "public",
    "egroupware.org:type": "task"
}
✅ Parent Task urn:uuid:b8a26c8d-d605-45b0-8e15-cbabb8aa105d confirmed. Proceeding with sub-task creation...
🔹 Sending request to EGroupware: {
  "title": "Room 101: Change bed linens and sheets",
  "start": "2025-03-31T11:50:53.984042+00:00",
  "timeZone": "Europe/Warsaw",
  "description": "Task Parent: Room 101\n        Area: Hotel\n        Task: Change bed linens and sheets",
  "priority": 5,
  "participants": [
    {
      "@type": "participant",
      "name": "housekeeping",
      "uri": "principals/groups/housekeeping/",
      "email": "housekeeping@jesshotel.pl",
      "kind": "group",
      "roles": {
        "attendee": true
      }
    }
  ],
  "status": "confirmed",
  "progress": "needs-action",
  "relatedTo": {
    "urn:uuid:b8a26c8d-d605-45b0-8e15-cbabb8aa105d": {
      "@type": "Relation",
      "relation": "parent"
    }
  }
}
🔹 Response status: 422
🔹 Response text: {
    "error": 422,
    "message": "Error parsing JsTask attribute 'relatedTo': UID 'urn:uuid:b8a26c8d-d605-45b0-8e15-cbabb8aa105d' NOT found!"
}
⚠️ Error creating task: {
    "error": 422,
    "message": "Error parsing JsTask attribute 'relatedTo': UID 'urn:uuid:b8a26c8d-d605-45b0-8e15-cbabb8aa105d' NOT found!"
}
🔹 Sending request to EGroupware: {
  "title": "Room 101: Vacuum the entire room and bathroom",
  "start": "2025-03-31T11:50:54.061220+00:00",
  "timeZone": "Europe/Warsaw",
  "description": "Task Parent: Room 101\n        Area: Hotel\n        Task: Vacuum the entire room and bathroom",
  "priority": 5,
  "participants": [
    {
      "@type": "participant",
      "name": "housekeeping",
      "uri": "principals/groups/housekeeping/",
      "email": "housekeeping@jesshotel.pl",
      "kind": "group",
      "roles": {
        "attendee": true
      }
    }
  ],
  "status": "confirmed",
  "progress": "needs-action",
  "relatedTo": {
    "urn:uuid:b8a26c8d-d605-45b0-8e15-cbabb8aa105d": {
      "@type": "Relation",
      "relation": "parent"
    }
  }
}
🔹 Response status: 422
🔹 Response text: {
    "error": 422,
    "message": "Error parsing JsTask attribute 'relatedTo': UID 'urn:uuid:b8a26c8d-d605-45b0-8e15-cbabb8aa105d' NOT found!"
}
⚠️ Error creating task: {
    "error": 422,
    "message": "Error parsing JsTask attribute 'relatedTo': UID 'urn:uuid:b8a26c8d-d605-45b0-8e15-cbabb8aa105d' NOT found!"
}
🔹 Sending request to EGroupware: {
  "title": "Room 101: Dust the desk, wardrobe, doors, windowsills, lamps",
  "start": "2025-03-31T11:50:54.129075+00:00",
  "timeZone": "Europe/Warsaw",
  "description": "Task Parent: Room 101\n        Area: Hotel\n        Task: Dust the desk, wardrobe, doors, windowsills, lamps",
  "priority": 5,
  "participants": [
    {
      "@type": "participant",
      "name": "housekeeping",
      "uri": "principals/groups/housekeeping/",
      "email": "housekeeping@jesshotel.pl",
      "kind": "group",
      "roles": {
        "attendee": true
      }
    }
  ],
  "status": "confirmed",
  "progress": "needs-action",
  "relatedTo": {
    "urn:uuid:b8a26c8d-d605-45b0-8e15-cbabb8aa105d": {
      "@type": "Relation",
      "relation": "parent"
    }
  }
}
🔹 Response status: 422
🔹 Response text: {
    "error": 422,
    "message": "Error parsing JsTask attribute 'relatedTo': UID 'urn:uuid:b8a26c8d-d605-45b0-8e15-cbabb8aa105d' NOT found!"
}
⚠️ Error creating task: {
    "error": 422,
    "message": "Error parsing JsTask attribute 'relatedTo': UID 'urn:uuid:b8a26c8d-d605-45b0-8e15-cbabb8aa105d' NOT found!"
}
🔹 Sending request to EGroupware: {
  "title": "Room 101: Clean the kettle and cups",
  "start": "2025-03-31T11:50:54.204182+00:00",
  "timeZone": "Europe/Warsaw",
  "description": "Task Parent: Room 101\n        Area: Hotel\n        Task: Clean the kettle and cups",
  "priority": 5,
  "participants": [
    {
      "@type": "participant",
      "name": "housekeeping",
      "uri": "principals/groups/housekeeping/",
      "email": "housekeeping@jesshotel.pl",
      "kind": "group",
      "roles": {
        "attendee": true
      }
    }
  ],
  "status": "confirmed",
  "progress": "needs-action",
  "relatedTo": {
    "urn:uuid:b8a26c8d-d605-45b0-8e15-cbabb8aa105d": {
      "@type": "Relation",
      "relation": "parent"
    }
  }
}
🔹 Response status: 422
🔹 Response text: {
    "error": 422,
    "message": "Error parsing JsTask attribute 'relatedTo': UID 'urn:uuid:b8a26c8d-d605-45b0-8e15-cbabb8aa105d' NOT found!"
}
⚠️ Error creating task: {
    "error": 422,
    "message": "Error parsing JsTask attribute 'relatedTo': UID 'urn:uuid:b8a26c8d-d605-45b0-8e15-cbabb8aa105d' NOT found!"
}
🔹 Sending request to EGroupware: {
  "title": "Room 101: Refill the coffee and tea set, leave a bottle of water",
  "start": "2025-03-31T11:50:54.283952+00:00",
  "timeZone": "Europe/Warsaw",
  "description": "Task Parent: Room 101\n        Area: Hotel\n        Task: Refill the coffee and tea set, leave a bottle of water",
  "priority": 5,
  "participants": [
    {
      "@type": "participant",
      "name": "housekeeping",
      "uri": "principals/groups/housekeeping/",
      "email": "housekeeping@jesshotel.pl",
      "kind": "group",
      "roles": {
        "attendee": true
      }
    }
  ],
  "status": "confirmed",
  "progress": "needs-action",
  "relatedTo": {
    "urn:uuid:b8a26c8d-d605-45b0-8e15-cbabb8aa105d": {
      "@type": "Relation",
      "relation": "parent"
    }
  }
}
🔹 Response status: 422
🔹 Response text: {
    "error": 422,
    "message": "Error parsing JsTask attribute 'relatedTo': UID 'urn:uuid:b8a26c8d-d605-45b0-8e15-cbabb8aa105d' NOT found!"
}
⚠️ Error creating task: {
    "error": 422,
    "message": "Error parsing JsTask attribute 'relatedTo': UID 'urn:uuid:b8a26c8d-d605-45b0-8e15-cbabb8aa105d' NOT found!"
}
🔹 Sending request to EGroupware: {
  "title": "Room 101: Check the hotel service brochure set, restock if necessary",
  "start": "2025-03-31T11:50:54.363272+00:00",
  "timeZone": "Europe/Warsaw",
  "description": "Task Parent: Room 101\n        Area: Hotel\n        Task: Check the hotel service brochure set, restock if necessary",
  "priority": 5,
  "participants": [
    {
      "@type": "participant",
      "name": "housekeeping",
      "uri": "principals/groups/housekeeping/",
      "email": "housekeeping@jesshotel.pl",
      "kind": "group",
      "roles": {
        "attendee": true
      }
    }
  ],
  "status": "confirmed",
  "progress": "needs-action",
  "relatedTo": {
    "urn:uuid:b8a26c8d-d605-45b0-8e15-cbabb8aa105d": {
      "@type": "Relation",
      "relation": "parent"
    }
  }
}
🔹 Response status: 422
🔹 Response text: {
    "error": 422,
    "message": "Error parsing JsTask attribute 'relatedTo': UID 'urn:uuid:b8a26c8d-d605-45b0-8e15-cbabb8aa105d' NOT found!"
}
⚠️ Error creating task: {
    "error": 422,
    "message": "Error parsing JsTask attribute 'relatedTo': UID 'urn:uuid:b8a26c8d-d605-45b0-8e15-cbabb8aa105d' NOT found!"
}
🔹 Sending request to EGroupware: {
  "title": "Room 101: Clean the ceiling and remove cobwebs",
  "start": "2025-03-31T11:50:54.445143+00:00",
  "timeZone": "Europe/Warsaw",
  "description": "Task Parent: Room 101\n        Area: Hotel\n        Task: Clean the ceiling and remove cobwebs",
  "priority": 5,
  "participants": [
    {
      "@type": "participant",
      "name": "housekeeping",
      "uri": "principals/groups/housekeeping/",
      "email": "housekeeping@jesshotel.pl",
      "kind": "group",
      "roles": {
        "attendee": true
      }
    }
  ],
  "status": "confirmed",
  "progress": "needs-action",
  "relatedTo": {
    "urn:uuid:b8a26c8d-d605-45b0-8e15-cbabb8aa105d": {
      "@type": "Relation",
      "relation": "parent"
    }
  }
}
🔹 Response status: 422
🔹 Response text: {
    "error": 422,
    "message": "Error parsing JsTask attribute 'relatedTo': UID 'urn:uuid:b8a26c8d-d605-45b0-8e15-cbabb8aa105d' NOT found!"
}
⚠️ Error creating task: {
    "error": 422,
    "message": "Error parsing JsTask attribute 'relatedTo': UID 'urn:uuid:b8a26c8d-d605-45b0-8e15-cbabb8aa105d' NOT found!"
}
🔹 Sending request to EGroupware: {
  "title": "Room 101: Clean the fridge, discard any leftover products",
  "start": "2025-03-31T11:50:54.520845+00:00",
  "timeZone": "Europe/Warsaw",
  "description": "Task Parent: Room 101\n        Area: Hotel\n        Task: Clean the fridge, discard any leftover products",
  "priority": 5,
  "participants": [
    {
      "@type": "participant",
      "name": "housekeeping",
      "uri": "principals/groups/housekeeping/",
      "email": "housekeeping@jesshotel.pl",
      "kind": "group",
      "roles": {
        "attendee": true
      }
    }
  ],
  "status": "confirmed",
  "progress": "needs-action",
  "relatedTo": {
    "urn:uuid:b8a26c8d-d605-45b0-8e15-cbabb8aa105d": {
      "@type": "Relation",
      "relation": "parent"
    }
  }
}
🔹 Response status: 422
🔹 Response text: {
    "error": 422,
    "message": "Error parsing JsTask attribute 'relatedTo': UID 'urn:uuid:b8a26c8d-d605-45b0-8e15-cbabb8aa105d' NOT found!"
}
⚠️ Error creating task: {
    "error": 422,
    "message": "Error parsing JsTask attribute 'relatedTo': UID 'urn:uuid:b8a26c8d-d605-45b0-8e15-cbabb8aa105d' NOT found!"
}
🔹 Sending request to EGroupware: {
  "title": "Room 101: Clean windows, frames, and windowsills (both sides)",
  "start": "2025-03-31T11:50:54.595860+00:00",
  "timeZone": "Europe/Warsaw",
  "description": "Task Parent: Room 101\n        Area: Hotel\n        Task: Clean windows, frames, and windowsills (both sides)",
  "priority": 5,
  "participants": [
    {
      "@type": "participant",
      "name": "housekeeping",
      "uri": "principals/groups/housekeeping/",
      "email": "housekeeping@jesshotel.pl",
      "kind": "group",
      "roles": {
        "attendee": true
      }
    }
  ],
  "status": "confirmed",
  "progress": "needs-action",
  "relatedTo": {
    "urn:uuid:b8a26c8d-d605-45b0-8e15-cbabb8aa105d": {
      "@type": "Relation",
      "relation": "parent"
    }
  }
}
🔹 Response status: 422
🔹 Response text: {
    "error": 422,
    "message": "Error parsing JsTask attribute 'relatedTo': UID 'urn:uuid:b8a26c8d-d605-45b0-8e15-cbabb8aa105d' NOT found!"
}
⚠️ Error creating task: {
    "error": 422,
    "message": "Error parsing JsTask attribute 'relatedTo': UID 'urn:uuid:b8a26c8d-d605-45b0-8e15-cbabb8aa105d' NOT found!"
}
🔹 Sending request to EGroupware: {
  "title": "Room 101: Wipe the entrance door to the room and bathroom",
  "start": "2025-03-31T11:50:54.676634+00:00",
  "timeZone": "Europe/Warsaw",
  "description": "Task Parent: Room 101\n        Area: Hotel\n        Task: Wipe the entrance door to the room and bathroom",
  "priority": 5,
  "participants": [
    {
      "@type": "participant",
      "name": "housekeeping",
      "uri": "principals/groups/housekeeping/",
      "email": "housekeeping@jesshotel.pl",
      "kind": "group",
      "roles": {
        "attendee": true
      }
    }
  ],
  "status": "confirmed",
  "progress": "needs-action",
  "relatedTo": {
    "urn:uuid:b8a26c8d-d605-45b0-8e15-cbabb8aa105d": {
      "@type": "Relation",
      "relation": "parent"
    }
  }
}
🔹 Response status: 422
🔹 Response text: {
    "error": 422,
    "message": "Error parsing JsTask attribute 'relatedTo': UID 'urn:uuid:b8a26c8d-d605-45b0-8e15-cbabb8aa105d' NOT found!"
}
⚠️ Error creating task: {
    "error": 422,
    "message": "Error parsing JsTask attribute 'relatedTo': UID 'urn:uuid:b8a26c8d-d605-45b0-8e15-cbabb8aa105d' NOT found!"
}

Ok, there was a missing backport, therefore the fix was NOT in the last maintenance release :frowning:

You need to patch the following 2 commits into your 23.1.20250307 container:

When the two commits are added to your container, relatedTo will be parsed also with “urn:uuid:” prefix:

cat <<EOF|curl -i -X POST https://boulder.egroupware.org/epl-23.1/groupdav.php/infolog/ -H "Content-Type:application/json" -H "Accept: application/pretty+json" -H "Prefer:return=representation" -d @- --user sysop
{"@type":"Task","title":"Subtask","start":"20250403T100000","timeZone":"Europe/Berlin","description":"Just a 2nd test","relatedTo":{"urn:uuid:c8e7e42d-e0dd-433b-bf99-1f6e778a75ea":{"@Type":"Relation","relation":"parent"}}} 
EOF
Enter host password for user 'sysop':

HTTP/1.1 201 Created
Server: nginx/1.26.3
Date: Thu, 03 Apr 2025 07:45:08 GMT
Content-Type: application/jscalendar+json;type=task;charset=utf-8
Transfer-Encoding: chunked
Connection: keep-alive
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate
Pragma: no-cache
X-Dav-Powered-By: EGroupware 23.1.011 CalDAV/CardDAV/GroupDAV server
Location: /epl-23.1/groupdav.php/infolog/10
Content-Location: https://boulder.egroupware.org/epl-23.1/groupdav.php/infolog/10
Content-Encoding: identity
ETag: "10:0:1743673508"
X-WebDAV-Status: 201 Created
X-Content-Type-Options: nosniff

{
    "@type": "Task",
    "prodId": "EGroupware InfoLog 23.1.011",
    "uid": "urn:uuid:ff7ce4a9-1af5-4d4d-8ff4-f6665b61b3b3",
    "created": "2025-04-03T07:45:08Z",
    "title": "Subtask",
    "start": "2025-04-03T10:00:00",
    "timeZone": "Europe/Berlin",
    "description": "Just a 2nd test",
    "participants": {
        "6": {
            "@type": "Participant",
            "name": "Admin User",
            "kind": "individual",
            "roles": { "owner": true }
        }
    },
    "status": "confirmed",
    "progress": "completed",
    "priority": 9,
    "privacy": "public",
    "egroupware.org:type": "task",
    "relatedTo": {
        "c8e7e42d-e0dd-433b-bf99-1f6e778a75ea": {
            "@type": "Relation",
            "relation": "parent"
        }
    }
}

Thanks for reporting that back :slight_smile:

Ralf