Is there another option to show Incident variable editor via UI Action?

DPrasna
Tera Contributor

Hi All,

 

The requirement is to create Incident from RITM via UI Action. As I know it can be done by many available options, the ask is to have Incident variable editor on the Incident created.

Is it possible in any way?

3 REPLIES 3

Kieran Anson
Kilo Patron

Hi,

For the variable editor to show, you would need to submit the incident via a record producer. You could do this in two ways

  1. If you need further information before submitting the incident, direct the user to a record producer for them to fill out. You can pass information via the UI action to relate the record producer to the source RITM.
  2. If you have all the necessary information, use the CatItem API to submit the require record producer. This replaces the need to use GlideRecord

KKM
Tera Guru

@DPrasna - Yes, it is possible to create an Incident from an RITM (Request Item) via UI Action while also displaying the Incident variable editor on the created Incident record

Approaches:

  1. Using GlideRecord in UI Action (Client-Script + GlideAjax)

    • Create a UI Action on sc_req_item (RITM) to generate an Incident using GlideRecord.
    • Populate required fields and use current.insert() to create the Incident.
    • Redirect the user to the newly created Incident form.
  2. Using Record Producer (Recommended)

    • Instead of creating the Incident manually, trigger a Record Producer for the incident table.
    • Record Producer automatically maps the variables and displays them in the variable editor.
    • Use a UI Action to open the Record Producer while passing values dynamically.
  3. Using UI Action with URL Redirection

    • Redirect to the Incident creation page while pre-filling values using URL parameters.
    • Example:
       
      var incidentURL = "/incident.do?sys_id=-1&sysparm_query=caller_id=" + current.request.requested_for; action.setRedirectURL(incidentURL);
    • However, this won't pre-populate variables unless you use Record Producer.

Best Option is to use Record Producer Approach:

  • If you need the variable editor, the best approach is to create a Record Producer for Incident.
  • In the UI Action, redirect the user to this Record Producer, passing RITM values dynamically.

Kindly mark it as correct/helpful, it it resolves your query. Please press "like" button to vote or write comments.
With Regards,

Krishna Kumar M

KKM
Tera Guru

@DPrasna  - Yes, it is possible to create an Incident from an RITM (Request Item) via UI Action while also displaying the Incident variable editor on the created Incident record

Approaches:

  1. Using GlideRecord in UI Action (Client-Script + GlideAjax)

    • Create a UI Action on sc_req_item (RITM) to generate an Incident using GlideRecord.
    • Populate required fields and use current.insert() to create the Incident.
    • Redirect the user to the newly created Incident form.
  2. Using Record Producer (Recommended)

    • Instead of creating the Incident manually, trigger a Record Producer for the incident table.
    • Record Producer automatically maps the variables and displays them in the variable editor.
    • Use a UI Action to open the Record Producer while passing values dynamically.
  3. Using UI Action with URL Redirection

    • Redirect to the Incident creation page while pre-filling values using URL parameters.
    • Example:
       
      var incidentURL = "/incident.do?sys_id=-1&sysparm_query=caller_id=" + current.request.requested_for; action.setRedirectURL(incidentURL);
    • However, this won't pre-populate variables unless you use Record Producer.

Best Option is to use Record Producer Approach:

  • If you need the variable editor, the best approach is to create a Record Producer for Incident.
  • In the UI Action, redirect the user to this Record Producer, passing RITM values dynamically.

Kindly mark it as correct/helpful, it it resolves your query. Please press "like" button to vote or write comments.
With Regards,

Krishna Kumar M