I had a look into the code again and I believe there is a bug there. The create ticket function uses another function to handle the query parameters. That function uses a "request_fields" list in the consts.py and iterate over it and "template" its not one of the fields. These are the fields listed there: REQUEST_FIELDS = [
"subject",
"description",
"request_type",
"impact",
"status",
"mode",
"level",
"urgency",
"priority",
"service_category",
"requester",
"assets",
"site",
"group",
"technician",
"category",
"subcategory",
"item",
"email_ids_to_notify",
"is_fcr",
"resources",
"udf_fields",
"update_reason",
] The function: def get_query_params(self, param):
request_fields = {}
for field in consts.REQUEST_FIELDS:
value = param.get(field, None)
if value:
if field in ["udf_fields", "template"]:
request_fields[field] = f"{self.format_params(field, value)}"
elif field not in consts.FIELDS_WITH_NAME or (value[0] == "{" and value[-1] == "}"):
request_fields[field] = value
else:
request_fields[field] = {"name": value}
return {"request": request_fields} The function itself has a clause to handle the "template" field but since it's not on the request_fields list it does not even get to that point in the code. This can probably be fixed just by adding "template" in the list.
... View more