-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TicketCreate() assumes falsely that a ticket number looks like a number (an int) #46
Comments
Same issue is found when calling TicketUpdate(). |
Agreed that the assumption of a ticket number that strictly consists of numbers should be removed. Will think about how to implement this (pull request is also welcome...) |
As a workaround, I have modified my python-otrs/otrs/ticket/operations.py as follows (just a quick hack that probably could be even simpler, shown below as a diff). The statement that hurts is: It appears in the "class TicketCreate" and in the "class TicketUpdate" definitions, so I applied the change the change to both places.
|
My OTRS instance has a specific ticket number generator, so ticket numbers are not made of digits only (an example of ticket number in my system is "210315-VT1203" ). Apparently (and if I understand), non-numeric ticket numbers cause TicketCreate() to fail when it generates its return infos.
For example I have a ticket number like "210315-VT1203" and I obtained this error (although the ticket is created as expected):
Traceback (most recent call last):
File "./testpyotrs.py", line 45, in
createtest()
File "./testpyotrs.py", line 37, in createtest
client.tc.TicketCreate(t, a,) # [df1, df2], [att1])
File "/usr/local/lib/python3.6/site-packages/otrs/client.py", line 109, in add_auth
return func(self, *args, **kwargs)
File "/usr/local/lib/python3.6/site-packages/otrs/ticket/operations.py", line 46, in call
infos = {extract_tagname(i): int(i.text) for i in elements}
File "/usr/local/lib/python3.6/site-packages/otrs/ticket/operations.py", line 46, in
infos = {extract_tagname(i): int(i.text) for i in elements}
ValueError: invalid literal for int() with base 10: '210315-VT1203'
Thanks
The text was updated successfully, but these errors were encountered: