[30e88f42] Einfügen
Einfügen
This commit is contained in:
@@ -157,17 +157,26 @@ class SuperOfficeClient:
|
||||
import datetime
|
||||
now = datetime.datetime.utcnow().isoformat() + "Z"
|
||||
|
||||
# SuperOffice UI limit: 42 chars.
|
||||
# We put exactly this in the FIRST line of the description.
|
||||
short_title = (subject[:39] + '...') if len(subject) > 42 else subject
|
||||
|
||||
# SuperOffice often 'steals' the first line of the description for the list view header.
|
||||
# So we give it exactly the subject it wants, then two newlines for the real body.
|
||||
formatted_description = f"{short_title}\n\n{description}"
|
||||
|
||||
payload = {
|
||||
"Description": f"{subject}\n\n{description}",
|
||||
"Description": formatted_description,
|
||||
"Contact": {"ContactId": contact_id},
|
||||
"StartDate": now,
|
||||
"EndDate": now,
|
||||
"Task": {"Id": 1} # Usually 'Follow-up' or similar, depending on SO config
|
||||
"MainHeader": short_title,
|
||||
"Task": {"Id": 1}
|
||||
}
|
||||
if person_id:
|
||||
payload["Person"] = {"PersonId": person_id}
|
||||
|
||||
print(f"Creating new appointment: {subject}...")
|
||||
logger.info(f"Creating new appointment: {short_title}...")
|
||||
return self._post("Appointment", payload)
|
||||
|
||||
def update_entity_udfs(self, entity_id: int, entity_type: str, udf_data: dict):
|
||||
|
||||
Reference in New Issue
Block a user