how to create an idea from incident servicenow

ying zeng
Tera Contributor

can anyone tell me how to create an idea from an incident or request  item?

 

4 REPLIES 4

kamlesh13
Tera Contributor

Hi @ying zeng,

 

You can use Business Rules or Script Includes to achieve this. Below is a simplified example using a Business Rule to create an idea from an incident when certain criteria are met. Please note that this is a basic example and would need further customization to work effectively in a production environment.

 

// Business Rule: Create Idea from Incident
// Table: Incident [incident]

(function executeRule(current, previous /*, gs*/) {
  // Define the criteria to trigger the creation of an idea
  if (current.state == 3 && current.priority == 1) {
    // Create a new Idea record
    var idea = new GlideRecord('idea');
    idea.initialize();

    // Populate the Idea record with information from the Incident
    idea.short_description = 'Idea to improve password reset process';
    idea.description = 'Implement self-service password reset portal based on incident ' + current.number;
    idea.impact = 2; // Set the desired impact level
    idea.urgency = 2; // Set the desired urgency level
    idea.assignment_group = current.assignment_group; // Assign to the same group as the incident
    idea.assigned_to = current.assigned_to; // Assign to the same person as the incident

    // Insert the Idea record
    var ideaID = idea.insert();
    
    // Link the Idea to the Incident
    current.idea = ideaID;
    current.update();
  }
})(current, previous);

 

  1. We specify the conditions that trigger the creation of an idea (e.g., when the incident state is "Resolved" and priority is "High").

  2. We create a new Idea record using a GlideRecord.

  3. We populate the Idea record with relevant information, such as a short description, description, impact, urgency, assignment group, and assigned-to user.

  4. We insert the Idea record, and then link it to the original incident by updating the incident's "idea" field with the newly created idea's sys_id.

 

 

Regards,

Kamlesh

Hi, the issue with this solution is that the idea will not show up in the idea portal so that folks can vote for it...I am having a similar issue! Do you happen to have any thoughts on how to achieve this? Thank you in advance!

You need to set the module on the idea record and also a category that belongs to that module on the following table 'im_m2m_idea_category'.

Once the idea has a module and category assigned it should appear on the Idea portal.

Community Alums
Not applicable

Hi @ying zeng ,

Unfortunately there is no OOTB solution to create a Idea from Incident/ Request Item.