I’m getting data for an OTRS ticket A with OTRS 6’s Ticket::TicketSearch operation via a Python requests call. I want to make a new ticket B whose body text is the same as ticket A’s body text. I keep getting back the error {'Error': {'ErrorMessage': 'TicketCreate: Ticket parameter is missing or not valid!', 'ErrorCode': 'TicketCreate.MissingParameter'}}
when I try to call Ticket::TicketCreate to do this.
I’m trying to call Ticket::TicketCreate (documentation I’m following) for this. From what I can tell the fields below are what OTRS 6 requires for this call. Am I missing something else? The TicketCreate.MissingParameter
error seems to suggest I’m either not including something the operation needs or my parameters into Python’s requests.get() function are malformed, but I can’t think of why the latter would be happening.
urlForAPI = webserviceURL + '/TicketCreate?'
reqHeaders = {'Accept': 'application/json'}
params = {
'UserLogin': OTRSLogin,
'Password': OTRSPassword,
'Ticket': {
'Title': 'some title',
'QueueID': 27,
'StateID': 3,
'PriorityID': 3
},
'Article': {
'CommunicationChannel': 'Email',
'CommunicationChannelID': 1,
'IsVisibleForCustomer': 1,
'ArticleSend': 1,
'From': fromEmail,
'Subject': 'some title',
'Body': bodyTicketA,
'ContentType': 'text/plain; charset=utf-8'
}
}
response = requests.get(url=urlForAPI, params=params, headers=reqHeaders)
AmberT is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.