demisto / content-docs

Demisto Content Developer Docs
https://xsoar.pan.dev/
MIT License
41 stars 59 forks source link

Issue with "OTRS" in @site/docs/reference/integrations/otrs.md #849

Closed saiiman closed 2 years ago

saiiman commented 2 years ago

Describe the problem

While setting up the OTRS integration I encountered some problems. First of all, I did not find any information on how to name the corresponding OTRS web service. Unfortunately, the name is an important detail to establish a connection. Second, I was not able to retrieve incidents (OTRS Integration - fetch Incidents) or use the otrs-get-ticket command with a given ticket_number after the prober setup. For the setup I used the OTRS web service template which is linked on the XSOAR documentation page. (https://gitlab.com/rhab/PyOTRS/raw/master/webservices_templates/GenericTicketConnectorREST.yml)

Environment

Suggested fix

Please consider to update your documentation and give the user the hint to name the used OTRS web service as follows: GenericTicketConnectorREST. This information can also be checked in the XSOAR debug logs of any OTRS command.

I was able to fix the second problem by adding a new web service endpoint on OTRS side. I would recommend updating the given template or writing a note about the missing endpoint. Below you can find the corresponding update to the template.

---
Debugger:
  DebugThreshold: debug
  TestMode: '0'
Description: Ticket Connector REST
FrameworkVersion: 6.0.38
Provider:
  Operation:
    TicketSearchGET:
      Description: 'Search for Tickets by e.g. ticket_number or TicketCreateTimeNewerDate'
      IncludeTicketData: '0'
      Type: Ticket::TicketSearch
[...]
  Transport:
    Config:
      AdditionalHeaders: ~
      KeepAlive: ''
      MaxLength: '100000000'
      RouteOperationMapping
        TicketSearchGET:
          RequestMethod:
          - GET
          Route: /Ticket
[...]
welcome[bot] commented 2 years ago

Hi and welcome to our Content Developer Docs project! Thanks and congrats for opening your very first issue. If you know the fix, you may also submit a PR to fix the issue if you like!

Noy-Maimon commented 2 years ago

Hi @saiiman, thank you for the info. About the first problem - a suitable comment is added to the documentation. About the second problem - I was able to use the given template and both fetch incidents and otrs-get-ticket command with ticket_number seems to work. Can you please attach the full template you used (the one you added that endpoint to)?

saiiman commented 2 years ago

Hi @Noy-Maimon, below you will find the complete template of the OTRS WebService.

---
Debugger:
  DebugThreshold: debug
  TestMode: '0'
Description: Ticket Connector REST
FrameworkVersion: 6.0.38
Provider:
  Operation:
    SessionCreate:
      Description: Creates a new Session by providing UserLogin or CustomerUserLogin
        and Password
      MappingInbound: {}
      MappingOutbound: {}
      Type: Session::SessionCreate
    SessionGet:
      Description: Check and validate a Session ID
      MappingInbound: {}
      MappingOutbound: {}
      Type: Session::SessionGet
    TicketCreate:
      Description: Creates a Ticket
      MappingInbound: {}
      MappingOutbound: {}
      Type: Ticket::TicketCreate
    TicketGet:
      Description: Retrieves Ticket data
      MappingInbound: {}
      MappingOutbound: {}
      Type: Ticket::TicketGet
    TicketGetList:
      Description: Retrieves Ticket data for a List of Ticket IDs
      MappingInbound: {}
      MappingOutbound: {}
      Type: Ticket::TicketGet
    TicketSearch:
      Description: Search for Tickets
      MappingInbound: {}
      MappingOutbound: {}
      Type: Ticket::TicketSearch
    TicketSearchGET:
      Description: ''
      IncludeTicketData: '0'
      Type: Ticket::TicketSearch
    TicketUpdate:
      Description: Updates a Ticket
      MappingInbound: {}
      MappingOutbound: {}
      Type: Ticket::TicketUpdate
  Transport:
    Config:
      AdditionalHeaders: ~
      KeepAlive: ''
      MaxLength: '100000000'
      RouteOperationMapping:
        SessionCreate:
          RequestMethod:
          - POST
          Route: /Session
        SessionGet:
          RequestMethod:
          - GET
          Route: /Session/:SessionID
        TicketCreate:
          RequestMethod:
          - POST
          Route: /Ticket
        TicketGet:
          RequestMethod:
          - GET
          Route: /Ticket/:TicketID
        TicketGetList:
          RequestMethod:
          - GET
          Route: /TicketList
        TicketSearch:
          RequestMethod:
          - POST
          Route: /TicketSearch
        TicketSearchGET:
          RequestMethod:
          - GET
          Route: /Ticket
        TicketUpdate:
          RequestMethod:
          - PATCH
          Route: /Ticket/:TicketID
    Type: HTTP::REST
RemoteSystem: ''
Requester:
  Transport:
    Type: ''
Noy-Maimon commented 2 years ago

Thanks for the update. After testing in our environment, both fetching and using that command, both seems to work with the given template. As we did not see this issue from any other user, this is possibly a local issue in your env. Plus, as this is the API's template (and not ours), we do not want to suggest fixes that are not instructed by the OTRS API itself. What type of error did you receive? How was the fetching not enabled? we can supply that info in the error message to help users that might encounter that as well in the future.

saiiman commented 2 years ago

Yes, maybe it was a problem on my end. The error message basically said that the API endpoint is not known. That's why I added the /Ticket endpoint using the GET method. Unfortunately, I no longer have access to my environment and I have also not found any other users complaining about the problem. Thanks for your help and I think you can close the issue.

Noy-Maimon commented 2 years ago

Thanks again, and please let us know if anything similar reoccurs.