senthilvaithees
Tera Guru

Hi All,

I created my first Now Experience UI Component which creates,gets and cancel incident in Agent workspace.

I have created a tab section using now-tabs component which contains three tabs as create,get and cancel incident.

Create Incident - This tab is used to create an incident, which allows user to enter the short description. The input field is build using now-input component. Once the input field is entered and create incident button is clicked, this triggers NOW_BUTTON#CLICKED action and using HTTP Effect API we can create an incident with the short description in the instance which intern returns the response with which we can show as an alert to the user.

Get Incident - This tab is used to get incident short description and link to the incident once we entered the incident number. The input and button component is same as create incident. But for getting the incident this function uses the GraphQL API. The GraphQL API is Fast and Flexible. Please refer this developer link to learn more about GraphQL Api in UI Component. So using this api we can get the incident short description and the url to redirect to that incident. Before using the GraphQL api make sure that u have created GraphQL Api entries in ur instance and also create GraphQL scripted revolvers and scripted mappings.

Cancel Incident - This tab is used to cancel the incident that the user enters. When the user clicks on cancel incident button after entering the incident number , this again triggers the GraphQL API which retrieves the sys_id of the incident and again creates the HTTP Effect API to set the incident state to cancelled.

 Please refer this GitHub link for the code

Comments
Rakesh Goel
Kilo Expert

Hey  Senthilvaitheeswaran,

 

Thanks for this Article.

Can you please share GraphQL schema that you have defined in your instance with Schema name space: incident and Application name space as x532635MyorgI1. My code is not working properly and I want to know the reason.

 

Thanks,

Rakesh Goel

 

Version history
Last update:
‎11-02-2020 10:53 PM
Updated by: