Giter VIP home page Giter VIP logo

python-otrs's People

Contributors

challs avatar dtrudg avatar ewsterrenburg avatar jocelyndelalande avatar kishorbhat avatar markusrippl-dlr avatar mjducharme avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

python-otrs's Issues

BUg in GenericTicketConnector class

Hi. I get this issue while trying to check GenericTicketConnector class - while I'm trying to access any methods of this class i get an 502 error, 'cos of incorrect endpoint server/otrs/nph-genericinterface.pl/Webservice/webservice_name. Trying to fix this issue leaves me to an empty response from server.

better or more Ticketsearch operations

Is it possible to get mor than the list of TicketIDs back, so maybe a JSON Dict with title, id, creator and so on ? Is it planned to implement such function ?

Invalid syntax on client.py

Hello !

I am trying to use this program via virtualenv, but it seems the client.py does not working as the error here:

(virtualenv)[me@machine otrs]$ python otrs/otrsTry.py
Traceback (most recent call last):
File "otrs/otrsTry.py", line 1, in
from otrs.client import GenericTicketConnector
File "/home/users/me/projects/otrs/virtualenv/lib/python2.6/site-packages/otrs/client.py", line 18
d = {extract_tagname(i): i.text for i in tag.getchildren()}
------------------------------- ^
SyntaxError: invalid syntax

The piece of code I wrote is the basic of the tutorial present on README.rst

from otrs.client import GenericTicketConnector
from otrs.objects import Ticket, Article, DynamicField, Attachment

otrs_server_uri = r'http://localhost'
webservice_name = 'WebServiceConnector'
client = GenericTicketConnector(otrs_server_uri,webservice_name)
username = input("Please enter your OTRS username")
        password = getpass.getpass(stream=sys.stderr)
        client.user_session_register(username,password)
        print ('Connected !')

Note: I used Python 2.6 and also 3.5

Invalid Webservice Name but returning SessionID

I am getting the following error:
"BadStatusLine Exception when trying to reach https://cert2.corpnet.pl/otrs/nph-genericinterface.pl/Webservice/test. Are you using the correct webservice name?"

But in the webservice debugger, there is a successful connection and the service is returning the correct session id.

"""<soap:Envelope soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">soap:Bodyv0TKmhy5G8wwF0DLKDmCfk3xBL0ZTkrK</soap:Body></soap:Envelope>"""

Little Question

Hi Guys,
Is an expansion planned for the OTRS CMDB?
greetings
Modius

How to close user session?

Hi,

Is there a way to close a user session via the script (i.e. de-authenticate)? I ask because I am using this for our monitoring software to create tickets in OTRS, it calls a separate copy of this script for every issue. It seems the session remains open for a certain amount of time until timeout, and so I start running into issues if many tickets are created in the same time period, I have to adjust the OTRS restrictions for maximum sessions per user, etc. I probably would not need to change these settings if I could add a line into the script to have it de-authenticate, closing the session, when it has finished doing its work on the tickets.

Creating a ticket where the first article is a outbound email to someone

Is this possible? Looking through the TicketCreate code at the OTRS repo https://github.com/OTRS/otrs/blob/dcb3fdc98336baa30ff614d75d2069dcdba2a73f/Kernel/GenericInterface/Operation/Ticket/TicketCreate.pm it looks like the To field is set to the queue regardless of what you do https://github.com/OTRS/otrs/blob/dcb3fdc98336baa30ff614d75d2069dcdba2a73f/Kernel/GenericInterface/Operation/Ticket/TicketCreate.pm#L1296

I would like to create a ticket in OTRS and send a email to someone at the same time, via the API

I can see some hints on the internet that this is possible, but I have not figured it out yet.

Question: ticket_search by multiple OwnerIDs

In the ticket_search example, you show something like..

otrs.ticket_search(OwnerIDs=1)

How would I get a result set of tickets for multiple OwnerIDs?
I've tried a few things that didn't work and was just wondering if this feature was supported.

I have a workaround in place if not.

Thanks,

Not able to re-use stored session_id properly

Hi,

If you try to use an existing session_id (that you previously stored in a temporay file, for example), it will work OK unless the corresponding session_id doesn't exist (eg: has been removed) in the OTRS you're polling. In this case your SOAP operations will fail miserably.

python-otrs should be able to handle the case where a session_id fails to authenticate the SOAP operation and fall back to create a new session_id using regular login/password credentials.

Without such capability, python-otrs is not very fit for execution in cronjobs.

Here's an illustrative example of code I made to use python-otrs within a cronjob without creating hundreds of sessions in my OTRS instance every day:

# Open session with our ticketing system
server_uri = r'https://ticketing.fw.acme.org'
webservice_name = 'DefaultTicketConnector'
client = GenericInterfaceClient(server_uri, tc=GenericTicketConnectorSOAP(webservice_name))
# Try getting results using existing session_id. Fallback to create a new session when it doesn't work.
# TODO: This code doesn't handle the case when SessionCreate fails
try:
  session_file = open("/tmp/otrs_session","r")
  client.session_id = session_file.read()
  session_file.close()
  nb_new_tickets = len(client.tc.TicketSearch(States="new"))
  nb_unlock_tickets = len(client.tc.TicketSearch(States="open",Locks="unlock"))
except:
  session_id = client.tc.SessionCreate(user_login='read-only-soap-user', password='xxxxxxxxxxxx')
  session_file = open("/tmp/otrs_session","w")
  session_file.write(session_id)
  session_file.close()
  nb_new_tickets = len(client.tc.TicketSearch(States="new"))
  nb_unlock_tickets = len(client.tc.TicketSearch(States="open",Locks="unlock"))

GenericInterfaceClient: timeout parameter seems not to work

Hi,

I tried to connect to our OTRS system and I know there is a firewall so I can't get a connection. When I use the timeout parameter for GenericInterfaceClient, it waits ~6 minutes to disconnect no matter what I set the timeout value to.

webservice_name = 'GenericTicketConnectorSOAP'
otrs_client=GenericInterfaceClient("https://otrs.abc.de.fg", tc=GenericTicketConnectorSOAP(webservice_name), timeout=10)

which gets (after 270 seconds instead of 10 seconds):
<urlopen error [Errno 110] Connection timed out>

Regards, Holger

Error with ScriptAlias

There is an error when a ScriptAlias is set up different from the default otrs/.

In the source: client.py line 350. The value otrs/nph-genericinterface.pl/Webservice/ is fixed.

Thanks!

TicketGet with DynamicFields

TicketGet with Dynamic fields is not working. The fields are returned by OTRS (i checked the web service debugger and it shows them in the output), but instead of the dynamic fields being available as child objects (like articles), dynamic fields are not added to the python object. I think there needs to be a:

def dynamic_fields(self):
    try:
        return self.childs['DynamicField']
    except KeyError:
        return []

in both class Ticket and class Article because both tickets and articles can have dynamic fields. I don't know the code well enough to know if a child map is also needed.

Update article element

Hello again !

I am wondering about how use python-otrs to just update an element into an Article, but from now I only found about how update a ticket. I've tried the following piece of code:


updateTicketArticle(ticket,'Subject','information',update,ticket)

def updateTicketArticle(ticketID,attr,value,update,ticket):

        global client
        for art in ticket.articles():
                if (art.attrs[attr] == value):
                        art.Body = art.Body + "\n" + update
                        client.ticket_update(ticket_id=ticketID,article=art)
                        log.info('Ticket {} updated'.format(ticketID))
                        return True
        return False

However I had the following error:

File "otrs.py", line 64, in updateTicketArticle
client.ticket_update(ticket_id=ticketID,article=art)
File "/home/users/me/projects/virtualenv/lib/python2.7/site-packages/otrs/client.py", line 58, in add_auth
return func(self, _args, *_kwargs)
File "/home/users/me/projects/virtualenv/lib/python2.7/site-packages/otrs/client.py", line 345, in ticket_update
ret = self.req('TicketUpdate', **kwargs)
File "/home/users/me/projects/virtualenv/lib/python2.7/site-packages/otrs/client.py", line 142, in req
raise SOAPError(unpacked[0])

otrs.client.SOAPError: TicketUpdate: Article->Charset is invalid! (TicketUpdate.InvalidParameter)

Is there something existing about update an article ? :)

Support for additional connectors (ConfigItemConnector, FAQConnector)

I require support for the ConfigItemConnector in python-otrs, so that in addition to Tickets, I am able to work with Config items, etc. I am able to develop it myself, but first I found that the design of this code made it tricky to add new modules.

As a result, I spent quite a while re-architecting this, so that it is now very easy to add new modules to support the GenericConfigItemConnectorSOAP and other future connectors without cluttering things up too much.

In the process many methods have changed, but I carefully added methods to allow backward compatibility so that all existing code should work as before with this updated version.

https://github.com/mjducharme/python-otrs

I will be adding support for the ConfigItemConnector into this, but first I was hoping to get your feedback, because I would like to quickly get this to a state that you are happy to merge into your master (I would do a pull request to commit these changes). I am not a programmer by profession, but spent a long time researching the design of this and planning it out, so I hope I have done things in a sensible and python-ic way.

Thanks

base64 encoding for attachments with Python 3

The example given in the documentation:
att_content = base64.b64encode(att_file.read())
does not work, because the content string in the generated XML has a leading literal "b" and is enclosed with quotes (b'XXXXX' instead of just XXXXX). As a result, the contents is stored in OTRS but unreadable due to those unwanted characters.

As a workaround, I was obliged to do:
att_content = base64.b64encode(att_file.read()).decode('utf-8')

But the root cause of this is probably a bug in the way "unicode" function is defined in client.py when using python 3.

Ticket search with multiple StateIDs results in Traceback

When trying a ticket.search like described in the PyOTRS Docu I always ran into an Exception.

client.ticket_search(States=['new', 'open'],...)
*** AttributeError: 'str' object has no attribute 'to_xml'

also

client.ticket_search(StateIDs=[1, 4, 6, 7, 8, 10, 11],...)
*** AttributeError: 'int' object has no attribute 'to_xml'

What to do?

"out of memory" Exception while retrieving ticket with ~1G attachements

When trying to retrieve a large ticket with the following code:

try:
»   ticket = client.ticket_get(tid, get_articles=True, get_dynamic_fields=True, get_attachments=True)
»   show_ticket_info(ticket)
except Exception as ex:
»   print("FAIL!\nEXCEPTION: %s" % (ex))

I get a 'out of memory' exception. The attachments are about 937MB and the whole SOAP response seems to be about 1.3GB.

Can't seem to get full text search working using SOAP

Hello,

i struggle since about 3 months to get the full text search working via SOAP.

Already tried asking for help in the official otterhub forum, but noone seems to be able to help me here: OtterHub - OTRS Community | Full text search via SOAP and GenericTicketConnector

Here's what I use at the moment:

tickets = client.ticket_search(
    ContentSearch = 'OR',
    From = '%' + args['input'] + '%',
    To = '%' + args['input'] + '%',
    Cc = '%' + args['input'] + '%',
    Subject = '%' + args['input'] + '%',
    Body = '%' + args['input'] + '%',
    Title = '%' + args['input'] + '%'
)

... based on the example code in the Ticket.pm file in the OTRS source: https://github.com/OTRS/otrs/blob/1e908159a5dbdcfb94cc35d13bf15b04ac3e6a24/Kernel/System/LinkObject/Ticket.pm#L271-L282, but for some reason it always returns an empty array.

However, it works fine when I try a more simple search like:

tickets = client.ticket_search(
    Title = '%' + args['input'] + '%'
)

I want to search like the full text search in the web ui though. Any ideas?

Issue adding article to existing ticket

Hi,

I have successfully created tickets, searched tickets, and updated ticket details with this, but an attempt to add an article to a ticket results in an Internal Server Error in OTRS 5, the current release. I believe it is due to the organization of the XML submitted to OTRS - the ticket number and session ID should be in the XML before the Article, and instead the article is before those two.

Get data into an Article

Hello !

I tried to extract data from an Article object following the README file, but it seems the dynamicfields function into it does not working:

File "/home/users/me/projects/virtualenv/lib/python2.7/site-packages/otrs/objects.py", line 23, in getattr
return autocast(self.attrs[k])
KeyError: 'dynamicfields'

I did the following lines:

for el in ticket.articles():
   print(el.dynamicfields())

However, I showed the entire Article Object and studied it, and this is working by doing this:

for el in ticket.articles():
   print(el.attrs['CustomerUserID'])
   print(el.attrs['Subject'])
   print(el.attrs['Body'])

In otrs/objects.py, assumptions made by "autocast" are error-prone (for values with a leading zero)

In my use case, I have a dynamic field "SR Number" which stores some external ticket number. The fact is that those ticket numbers are made of digits only and may begin with "0" (zero), like e.g. "01234567".
When I search for tickets whose dynamic field "SR Number" is e.g. "01234567", this fails, because autocast changes the string value "01234567" to the "1234567" int, while I need it just stays as it is (the string "01234567").

I was obliged to modify the autocast function (in otrs/objects.py) by adding the 2 following lines just before the "try" statement:
if s.startswith("0"):
return s

Implement a Session Close ?

Hi,
is it anyway possible to implement a sessio close() method? Because In my case many user with many tickets will create a Session and I don't want to change the Sessionlimitation on the OTRS Server.

Kind regards

Erik

ticket PendingTime State

OTRS ticket State as a reminder, how to set the reminder datetime

t = Ticket(State='pending reminder',Priority='3 normal', Queue='IT Helpdesk',
Title=computer + 'Add Administrator', CustomerUser=samid,TimeUnit='10',
Type='Alert',Service='Alert::Administrator')

Sessions are dying very quickly

otrs.user_session_register(otrs_user, otrs_password)

this will work for a while, but after about 5 minutes we start getting:

File "./app.py", line 1315, in manage
otrs.user_session_register(otrs_user, otrs_password)
File "/home/.env/local/lib/python2.7/site-packages/otrs/client.py", line 199, in user_session_register
user_login=user)
File "/home/.env/local/lib/python2.7/site-packages/otrs/client.py", line 185, in session_create
Password=password)
File "/home/.env/local/lib/python2.7/site-packages/otrs/client.py", line 142, in req
raise SOAPError(unpacked[0])
otrs.client.SOAPError: SessionCreate: Authorization failing! (SessionCreate.AuthFail)

DebugLog error: Summary: TicketSearch.AuthFail Data : TicketSearch: Authorization failing!.
Sun Dec 13 10:42:18 2015 notice GenericInterfaceProvider-01 SessionID: 'VnHfKTPDWzAdJKXcdsnWyhM0dYArODJJ' is invalid!!!
Sun Dec 13 10:42:13 2015 error GenericInterfaceProvider-01 DebugLog error: Summary: TicketSearch.AuthFail Data : TicketSearch: Authorization failing!.
Sun Dec 13 10:42:13 2015 notice GenericInterfaceProvider-01 SessionID: 'VnHfKTPDWzAdJKXcdsnWyhM0dYArODJJ' is invalid!!!
Sun Dec 13 10:42:01 2015 error GenericInterfaceProvider-01 DebugLog error: Summary: TicketSearch.AuthFail Data : TicketSearch: Authorization failing!.
Sun Dec 13 10:42:01 2015 notice GenericInterfaceProvider-01 SessionID: 'VnHfKTPDWzAdJKXcdsnWyhM0dYArODJJ' is invalid!!!
Sun Dec 13 10:41:46 2015 error GenericInterfaceProvider-01 DebugLog error: Summary: TicketSearch.AuthFail Data : TicketSearch: Authorization failing!.
Sun Dec 13 10:41:46 2015 notice GenericInterfaceProvider-01 SessionID: 'VnHfKTPDWzAdJKXcdsnWyhM0dYArODJJ' is invalid!!!
Sun Dec 13 10:41:41 2015 error GenericInterfaceProvider-01 DebugLog error: Summary: TicketSearch.AuthFail Data : TicketSearch: Authorization failing!.
Sun Dec 13 10:41:41 2015 notice GenericInterfaceProvider-01 SessionID: 'VnHfKTPDWzAdJKXcdsnWyhM0dYArODJJ' is invalid!!!
Sun Dec 13 10:41:41 2015 error GenericInterfaceProvider-01 DebugLog error: Summary: TicketSearch.AuthFail Data : TicketSearch: Authorization failing!.
Sun Dec 13 10:41:41 2015 notice GenericInterfaceProvider-01 SessionID: 'pdrgv5u3lZRUXB3t1tjgbyboG9ggBEcr' is invalid!!!
Sun Dec 13 10:41:37 2015 error GenericInterfaceProvider-01 DebugLog error: Summary: TicketSearch.AuthFail Data : TicketSearch: Authorization failing!.
Sun Dec 13 10:41:37 2015 notice GenericInterfaceProvider-01 SessionID: 'pdrgv5u3lZRUXB3t1tjgbyboG9ggBEcr' is invalid!!!
Sun Dec 13 10:41:36 2015 error GenericInterfaceProvider-01 DebugLog error: Summary: TicketSearch.AuthFail Data : TicketSearch: Authorization failing!.
Sun Dec 13 10:41:36 2015 notice GenericInterfaceProvider-01 SessionID: 'VnHfKTPDWzAdJKXcdsnWyhM0dYArODJJ' is invalid!!!
Sun Dec 13 10:41:31 2015 error GenericInterfaceProvider-01 DebugLog error: Summary: TicketSearch.AuthFail Data : TicketSearch: Authorization failing!.
Sun Dec 13 10:41:31 2015 notice GenericInterfaceProvider-01 SessionID: 'VnHfKTPDWzAdJKXcdsnWyhM0dYArODJJ' is invalid!!!
Sun Dec 13 10:41:23 2015 error GenericInterfaceProvider-01 DebugLog error: Summary: TicketSearch.AuthFail Data : TicketSearch: Authorization failing!.
Sun Dec 13 10:41:23 2015 notice GenericInterfaceProvider-01 SessionID: 'VnHfKTPDWzAdJKXcdsnWyhM0dYArODJJ' is invalid!!!
Sun Dec 13 10:41:23 2015 error GenericInterfaceProvider-01 DebugLog error: Summary: TicketSearch.AuthFail Data : TicketSearch: Authorization failing!.
Sun Dec 13 10:41:23 2015 notice GenericInterfaceProvider-01 SessionID: 'pdrgv5u3lZRUXB3t1tjgbyboG9ggBEcr' is invalid!!!
Sun Dec 13 10:41:14 2015 error GenericInterfaceProvider-01 DebugLog error: Summary: TicketSearch.AuthFail Data : TicketSearch: Authorization failing!.
Sun Dec 13 10:41:14 2015 notice GenericInterfaceProvider-01 SessionID: 'VnHfKTPDWzAdJKXcdsnWyhM0dYArODJJ' is invalid!!!
Sun Dec 13 10:41:14 2015 error GenericInterfaceProvider-01 DebugLog error: Summary: TicketSearch.AuthFail Data : TicketSearch: Authorization failing!.
Sun Dec 13 10:41:14 2015 notice GenericInterfaceProvider-01 SessionID: 'pdrgv5u3lZRUXB3t1tjgbyboG9ggBEcr' is invalid!!!
Sun Dec 13 10:41:01 2015 error GenericInterfaceProvider-01 DebugLog error: Summary: TicketSearch.AuthFail Data : TicketSearch: Authorization failing!.
Sun Dec 13 10:41:01 2015 notice GenericInterfaceProvider-01 SessionID: 'VnHfKTPDWzAdJKXcdsnWyhM0dYArODJJ' is invalid!!!
Sun Dec 13 10:41:01 2015 error GenericInterfaceProvider-01 DebugLog error: Summary: TicketSearch.AuthFail Data : TicketSearch: Authorization failing!.
Sun Dec 13 10:41:01 2015 notice GenericInterfaceProvider-01 SessionID: 'pdrgv5u3lZRUXB3t1tjgbyboG9ggBEcr' is invalid!!!
Sun Dec 13 10:40:38 2015 error GenericInterfaceProvider-01 DebugLog error: Summary: TicketSearch.AuthFail Data : TicketSearch: Authorization failing!.
Sun Dec 13 10:40:38 2015 notice GenericInterfaceProvider-01 SessionID: 'pdrgv5u3lZRUXB3t1tjgbyboG9ggBEcr' is invalid!!!
Sun Dec 13 10:40:38 2015 error GenericInterfaceProvider-01 DebugLog error: Summary: TicketSearch.AuthFail Data : TicketSearch: Authorization failing!.
Sun Dec 13 10:40:38 2015 notice GenericInterfaceProvider-01 SessionID: 'VnHfKTPDWzAdJKXcdsnWyhM0dYArODJJ' is invalid!!!

What is happening here?

TicketGet problem(delete, plz)

OTRS 6.0, python 2.7.


Code
rawtickets = client.tc.TicketSearch(Queues='Raw')

Output:
[21, 15, 12, 11, 10, 9, 8, 7, 6, 1]


Code

ticket = client.tc.TicketGet(21, get_articles=True) article = ticket.articles()[0]

or this one:

ticket = client.tc.TicketGet(ticket_id=21, get_articles=True) article = ticket.articles()[0]

Output:
<otrs.ticket.objects.Ticket object at 0x7efbfe3d81d0>


Help me, plz =)

Unicode codec error

When using python-otrs to submit an article where the text contains unicode (\u210c in this case), the following error occurs:

python-otrs

Apologies for screenshot instead of text

Looking in objects.py around line 103, I don't really understand what's going on here.

 def to_xml(self):
        """
        @returns am etree.Element
        """
        root = etree.Element(self.XML_NAME)
        for k, v in self.attrs.items():
            e = etree.Element(k)
            if isinstance(e, str):  #  True
                v = v.encode('utf-8')
            e.text = str(v)
            root.append(e)
        return root

The # True comment here suggests that v is always being encoded as utf-8, but then str(v) is applied where an encoding error is being raised.

Not sure whether this is a bug, or there is a certain way in which python-otrs is should be passed unicode content?

Thanks,

Search tickets between dates

I'd like to find tickets between dates , when using only one DF is works ....

df1 = DynamicField(Name='ResolvedDate', Value='2018-08-01 00:00:00', Operator="GreaterThanEquals")
df2 = DynamicField(Name='ResolvedDate', Value='2018-08-05 00:00:00', Operator="SmallerThan")

tickets = client.tc.TicketSearch(Queues='QUEUENAME',StateIDs=['2'],dynamic_fields=[df1]) -> works ok
tickets = client.tc.TicketSearch(Queues='QUEUENAME',StateIDs=['2'],dynamic_fields=[df2]) -> works ok

... but when I combine two df's , it does not work at all.

tickets = client.tc.TicketSearch(Queues='QUEUENAME',StateIDs=['2'],dynamic_fields=[df1][df2]) -> ko

tickets = client.tc.TicketSearch(Queues='QUEUENAME',StateIDs=['2'],dynamic_fields=[df1] and [df2]) -> ko
tickets = client.tc.TicketSearch(Queues='QUEUENAME',StateIDs=['2'],dynamic_fields=[df1] & [df2]) -> ko
tickets = client.tc.TicketSearch(Queues='QUEUENAME',StateIDs=['2'],dynamic_fields=[df1 and df2]) -> ko
tickets = client.tc.TicketSearch(Queues='QUEUENAME',StateIDs=['2'],dynamic_fields=[df1 & df2]) -> ko

please , could you help me ?

thank you in advance !

Ticket Pending time

I am tring to use TicketUpdate method to put a ticket into pending state, I cant put pendingTime to the ticket

$fechar_ticket = Ticket(State='Contingenciado', pendingTime={ 'Diff':10080,})
$client.tc.TicketUpdate(ticket_id=busca_df[0], ticket=fechar_ticket, article=artigo_fechar)

otrs.client.SOAPError: Can't set a ticket on a pending state without pendig time! (TicketUpdate.MissingParameter)

TicketCreate() assumes falsely that a ticket number looks like a number (an int)

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

ticket_search

$VAR1 = {
'ErrorMessage' => 'Got no OperationType!',
'Success' => 0
};

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.