Skip to content
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

As a user, I want to be able to submit requests via seamless ServiceNow integration #76

Open
alescernivec opened this issue Oct 30, 2022 · 13 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@alescernivec
Copy link
Contributor

Cisco Intersight ManageIQ Provider should support "incident" and "service requirement" types of Service Now tickets.

There are additional requirements that need to be taken into account:

  • Provide secrets for ServiceNow account (e.g., having user credentials configured within the provider setting)
  • Support for the attachments
  • Positioning ServiceNow Issue "submit button" in the portal (servers, chassis, switches, racks, storage)

We foresee different use cases:

  • Issuing a ticket from the main Cisco Intersight provider’s dashboard (Compute/Physical Infrastructure Providers/Dashboard ) where collection of all resources are listed.
  • Issuing a ticket from the Cisco Intersight provider collection's details page (e.g.,Compute/Physical Infrastructure/Servers/(Summary of a server)).
@Fryguy
Copy link
Member

Fryguy commented Nov 3, 2022

I'd like to discuss the design of this in a more holistic sense and not cisco intersight specific. We have had requests in the past for ServiceNow integration across all parts of the product, and at Red Hat they had ServiceNow integration via Automate which may be able to be reused [ref]. Since ServiceNow is not an integral part of cisco intersight itself, it should not be tightly coupled to the cisco intersight plugin. @agrare Thoughts?

@alescernivec
Copy link
Contributor Author

I fully agree with this and we are still examining the proposed idea for the integration. Thanks for the ref! Actually, we have already done some experimenting with this way of integration with ServiceNow.

@alescernivec
Copy link
Contributor Author

We've done some advances on this matter. We've managed to create a package based on the existing integration scripts (what has been referenced above) through Automation, and also we've managed to create related dialogs and a ServiceNow button in the physical provider. While simulating these (through "Simulate" option), everything looks OK. But when triggering the action from the physical provider via the button, we get this error (from development.log):

...
[----] F, [2022-11-10T12:03:00.910892 #14671:5a2a8] FATAL -- development: Error caught: [ActionController::UrlGenerationError] No route matches {:action=>"dialog_load", :controller=>"ems_physical_infra", :dialog_locals=>{:resource_action_id=>183, :target_id=>2, :target_type=>"ext_management_system", :real_target_type=>"ExtManagementSystem", :dialog_id=>3, :api_submit_endpoint=>"/api/providers/2", :api_action=>"Create Incident", :finish_submit_endpoint=>"/ems_infra", :cancel_endpoint=>"/ems_infra", :open_url=>false}, :id=>"2"}
/usr/share/rvm/gems/ruby-3.0.0/gems/actionpack-6.1.7/lib/action_dispatch/journey/formatter.rb:44:in `path'
/usr/share/rvm/gems/ruby-3.0.0/gems/actionpack-6.1.7/lib/action_dispatch/routing/route_set.rb:823:in `url_for'
/usr/share/rvm/gems/ruby-3.0.0/gems/actionpack-6.1.7/lib/action_dispatch/routing/url_for.rb:181:in `full_url_for'
/usr/share/rvm/gems/ruby-3.0.0/gems/actionpack-6.1.7/lib/action_dispatch/routing/url_for.rb:171:in `url_for'
/usr/share/rvm/gems/ruby-3.0.0/gems/actionview-6.1.7/lib/action_view/routing_url_for.rb:89:in `url_for'
/usr/share/rvm/gems/ruby-3.0.0/gems/jquery-rjs-0.1.1.3/lib/action_view/helpers/jquery_helper.rb:457:in `redirect_to'
/usr/share/rvm/gems/ruby-3.0.0/bundler/gems/manageiq-ui-classic-2b214a9671ad/app/helpers/application_helper.rb:968:in `block in javascript_redirect'
/usr/share/rvm/gems/ruby-3.0.0/gems/jquery-rjs-0.1.1.3/lib/action_view/helpers/jquery_helper.rb:154:in `instance_exec'
/usr/share/rvm/gems/ruby-3.0.0/gems/jquery-rjs-0.1.1.3/lib/action_view/helpers/jquery_helper.rb:154:in `block in initialize'
/usr/share/rvm/gems/ruby-3.0.0/gems/actionview-6.1.7/lib/action_view/helpers/capture_helper.rb:209:in `with_output_buffer'

@Fryguy perhaps you have some pointers on how to tackle this issue? Thanks in advance!

@eilam20
Copy link
Contributor

eilam20 commented Jan 10, 2023

@Fryguy hi, we check with our team how we solve this.
my suggestion is to add the button of service now in all the toolbars in the system throw the code and not in the automation engine.
when a user will click to create a new ticket he will enter the credentials of the service now instance for the first time.
the credentials will be stored in the authentications table in the manageiq and will be attached to separate providers (autosde, cisco_intersight, ext..)
next will redirect to create form page of the ticket and after submitting of the form a rest call will be done to create this ticket.

@Fryguy
Copy link
Member

Fryguy commented Jan 10, 2023

This sounds like the opposite of what I was saying earlier where I was preferring a common ServiceNow implementation (unless I'm misunderstanding?)

@eilam20
Copy link
Contributor

eilam20 commented Jan 11, 2023

@Fryguy it will be the same implementation for each page but it will give the user the ability to connect each provider to different service now instance.

@eilam20
Copy link
Contributor

eilam20 commented Jan 11, 2023

Or you prefer one configuration for the service now connection?

@Fryguy
Copy link
Member

Fryguy commented Jan 11, 2023

Yeah I think we'd want one service now connection, perhaps per tenant?

Where would you store all of this ServiceNow code if not automate? Would it be directly in core?

@eilam20
Copy link
Contributor

eilam20 commented Jan 12, 2023

ok so we will start with one service now connection.
I think it needs to be in the core.
the question is if we want to store this tickets values in the manageiq db or if we will create the rest call to the service now instance and end the process without saving the data?

@alescernivec
Copy link
Contributor Author

@eilam20 We've tackled the issue using Automate engine (mentioned above). Maybe this can help: Dialogs - https://github.com/xlab-si/ServiceNow_Dialogs and CMDB part - https://github.com/xlab-si/ServiceNow_CMDB . With this you can embed the dialog for ServiceNow in any provider.

@eilam20
Copy link
Contributor

eilam20 commented Feb 1, 2023

@Fryguy hi, I created a form to post the values to the service now API.
Do we want to use the miq API and add a new endpoint and module called service now?

@Fryguy
Copy link
Member

Fryguy commented Feb 7, 2023

hi all - sorry, I've been swamped lately and haven't been able to review any of this. If possible, let's get a call together so I can go back and forth with questions...I think we can quickly come to an architecture we agree on (I'm pretty sure it's close as is) - please also include @agrare.

@eilam20
Copy link
Contributor

eilam20 commented Feb 8, 2023

Hi, I wrote down some points and questions about the pre-development process.
I am also available next week to talk about things.

  • Add service now button- (Question: need to show in all the pages toolbars?)

Screenshot 2023-02-08 at 16 37 14

  • If there are no credentials related to the service now in the authentications table it will show the connect button.

Screenshot 2023-02-08 at 16 38 50

  • Else- it will show the add ticket button

Screenshot 2023-02-08 at 17 44 15

  • In the connect service now instance form the user needs to enter the following:
    domain
    username
    password

  • Question: set the table name for creating the ticket or set it in the create ticket form?

  • when the user submits the form a new record will be added to the authentications table with the credentials for this domain.

Now, when the user clicks on create new ticket he will need to add the ticket details that will be sent to the service now API.
the service now credentials will be taken from the authentications table and will be sent to the service now API.
Screenshot 2023-02-08 at 18 41 04

Questions:

  1. store the service now tickets details in the miq db?
  2. show the service now tickets in the miq system.
  3. add a module for service now connection and a new api endpoint?
  4. add a module for the service now ticket and a new api endpoint?
  5. need to add the instance from the miq system automatically to the ticket form? (for example: provider name, volume name, storage name...)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
3 participants