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

Hi,

You can use below:

function onChange(control, oldValue, newValue, isLoading) {
    if (isLoading || newValue == '') {
        return;
    }
if(newValue =='ABCD Edge'){
    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);
}
}

 

Make sure your onChange Client script is running when  particular field is changed and use Choice Value instead of Label in if condition.

 

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 updated the script , while doing testing it is not working 

 

nameisnani_0-1705494799230.png

 

Here in the portal not updating old text message still coming 

nameisnani_1-1705494961180.png

 

 

 

Could you please check let me know what was the mistake , and i have given value only .

What is name of your Multiline text variable?

I believe it must be "description" not comments.

 

Please update list line like based on your variable name:

g_form.setValue('descripton',description);   

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 

 

nameisnani_0-1705495372484.png

 

Hi @Anil Lande 

 

Almost it is worked out . TYSM