How to input values of fields inside Description of an incident?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-10-2024 02:47 AM
I am filling up the values of fields while raising an incident and then I want to see few of those field values inside description of an incident form.
Please assist.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-10-2024 02:55 AM
You can easily do this, for example if you have record producer then you can write below code.
current.description = producer.variable_name1 + "\n" + producer.variable_name2
Write something like this in Record producer script. if it is for creation from incident form then write something like above in before Business rule and in that instead of using producer you can use current with field name.
Regards,
Musab

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-10-2024 03:04 AM
@Mouktik_B Thanks for marking my response as helpful, I see I have provided you sample code, simply write this in record producer script with proper variable names and it will work.
current.description = producer.variable_name1 + "\n" + producer.variable_name2+ "\n" + producer.variable_name3;
Regards,
Musab
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-10-2024 03:00 AM
Hi,
you can use business rule to add fields to description using glide record on incident.
ex:
gr = new GlideRecord('incident');
current.description = current.description + "\n" + "Caller -" + current.callerID + "\n" + "State - " + current.state;
current.update();
Please note this is a snippet showing logic of your requirements and you will need to make changes.
If you found this helpful, please mark this reply as solution.
Thanks and Regards,
Ehab Pilloor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-10-2024 03:05 AM
Sure, you can achieve this by using a Business Rule in ServiceNow. Here are the steps: 1. Navigate to System Definition > Business Rules. 2. Click on New to create a new business rule. 3. Fill in the necessary fields: - Name: Give a meaningful name to the business rule. - Table: Select the Incident table. - When: Select "before". - Insert: Check this box. - Update: Check this box. 4. In the "Advanced" tab, write a script to concatenate the values of the fields you want to see in the description. Here is a sample script: javascript (function executeRule(current, previous /*null when async*/) { // Concatenate the values of the fields you want to see in the description var field1 = current.field1; var field2 = current.field2; var field3 = current.field3; // Set the description field current.description = 'Field1: ' + field1 + ', Field2: ' + field2 + ', Field3: ' + field3; })(current, previous); 5. Replace "field1", "field2", and "field3" with the actual field names you want to include in the description. 6. Click on Submit to save the business rule. Now, whenever an incident is created or updated, the description field will be automatically filled with the values of the specified fields.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-10-2024 08:50 AM
Great response .
The customer comes up as a sys Id and not the name , any solution for that?