0

So I am revieving this error when trying to modify the default connectwise integration in siemplify.

from ConnectWiseManager import ConnectWiseManager
File "/opt/siemplify/siemplify_server/bin/Scripting/PythonSDK/IntegrationsVirtualEnvironment/ConnectWiseCustom_V36.1/ojy1z01i.mho/ConnectWiseManager.py", line 403
update_time = f'{"ticket_id":{ticket_id}, "timeStart":{datetime.strftime(datetime_start, self._date_format)}, "timeEnd":{datetime.strftime(datetime_end, self._date_format)}, "member": {"identifier": {Identifier}}, "notes":{notes}, "chargeToType":{chargeToType}}'
^
SyntaxError: invalid syntax

My purpose is to send a post to create a new time entry for each closed ticket... and that needs to be in the format as seen here http://vc3.github.io/connectwise-rest-api/modules/_api_api_.timeentry.html#chargetoid .

I don't see anything wrong with this format as a manual way to create a JSON string? Any suggestions?

Barmar
  • 741,623
  • 53
  • 500
  • 612
  • 1
    If it's pointing at the `f`, you likely are using too old of a version of Python. Upgrade to 3.6+. – Carcigenicate Jun 23 '22 at 19:58
  • 1
    Don't create JSON strings manually. Use the `json` module. That's what it's for, and will work whatever your version of Python. – BoarGules Jun 23 '22 at 22:18

0 Answers0