Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Incident form description

nameisnani
Mega Sage

Hi Team ,

 

We have a requirement that in the create incident record producer i need to populate the below message 

 

• Incident Date and Time:
[Specify when the incident occurred, if applicable]

• Department:
[Indicate the department experiencing the issue (i.e. Operations, Distribution, Finance, SAS etc.)]

• Impacted Account/User Details:
[Include the below, if applicable]
Account name:
Account ID:
Client ID:
Adviser name:
Practice:
Dealer Group:

Impacted Functionality / Component:
[Detail the specific functionality or system component experiencing difficulties (i.e. Models, Pensions, Transfers, Fees, Onboarding, Platform etc.]

• Severity
[Specify the severity level based on the impact of the issue (Low, Medium, High)]

• Incident Description:
[Provide a detailed description of the issue, including any error messages or unusual behaviour observed]

• Steps to Reproduce:
[List the steps taken before encountering the issue including the step-by-step instructions on how to reproduce the issue]

• Actual Behaviour:
[Describe the current behaviour or state resulting from the reported problem]

• Expected Behaviour:
[Explain how the system is expected to behave under normal circumstances]

• Workaround Required?:
[Specify if there is a temporary solution or workaround available or if a workaround is required]

• Potential Risk Matter (Yes/No):
[Assess whether the issue poses a potential risk, answering Yes or No]

• Attachments (attach all relevant and available):
[Attach any files or screenshots that might assist in understanding and resolving the issue (i.e. screenshots of an error message, screenshots of impacted pages etc.]

• URL (if applicable):
[Include relevant URLs to pinpoint the specific location or page affected by the issue]

• Jira/Confluence Links:
[If applicable, provide links, URLs or IDs associated with Jira or Confluence such as requirement links]

• Related Links or Issues:
[Include any known related links or issue tickets (i.e. related SMT's, Dynamics cases, ServiceNow tickets, Jira ID's)]

 

In The Service Portal it has to come like this 

nameisnani_0-1705467100711.png

 

nameisnani_1-1705467172385.png

 

I am not getting the same format as shown in the 1st image . 

Based on some conditions this text as to be populate so it should be OnChange client script only .

 

can any one please provide me the correct script . here 

 

Thank in Adavnce .

 

@Saurav11  

 

10 REPLIES 10

Anil Lande
Kilo Patron

Hi,

You are adding additional character which might not be supported.

Please remove the bullet mark (dot)  from your client script.

 

Please appreciate the efforts of community contributors by marking appropriate response as correct answer and helpful, this may help other community users to follow correct solution in future.
Thanks
Anil Lande

@Anil Lande 

 

could you please provide me the example of script 

Hi,

You can use below logic:

var description = "Incident Date and Time: \n";
description= description+"[Specify when the incident occurred, if applicable] \n\n";  //doube because of additional line space
description= description+"Department: \n";
description= description+"[Indicate the department experiencing the issue (i.e. Operations, Distribution, Finance, SAS etc.)] \n";
description= description+"Impacted Account/User Details: \n";
description= description+"[Include the below, if applicable] \n";

// continue this for all new lines and use below at the end:

g_form.setValue('comment',description); 

 

First try for few lines (at least 5-6) and if that meets your requirement then add same logic for all lines.

 

Please appreciate the efforts of community contributors by marking appropriate response as correct answer and helpful, this may help other community users to follow correct solution in future.
Thanks
Anil Lande

Hi @Anil Lande 

 

I have to write onChange Cilnet script , and i want add if condition also

exampple -  if (newValue === "ACD Edge")

 

could you please provide me the script with if condtion

 

function onChange(control, oldValue, newValue, isLoading) {
    if (isLoading || newValue == '') {
        return;
    }

    //Type appropriate comment here, and begin script below

    var description = "Incident Date and Time: \n";
    description = description + "[Specify when the incident occurred, if applicable] \n\n"; //doube because of additional line space
    description = description + "Department: \n";
    description = description + "[Indicate the department experiencing the issue (i.e. Operations, Distribution, Finance, SAS etc.)] \n";
    description = description + "Impacted Account/User Details: \n";
    description = description + "[Include the below, if applicable] \n";




    // continue this for all new lines and use below at the end:

    g_form.setValue('comment', description);

}