How to I pass the Incident Number when creating an Incident Task using a related list?

Randy33
Tera Guru

I am trying to pass the incident number to an incident task when using a related list on a form.  How do I tackle this?

2 REPLIES 2

Harshal Aditya
Mega Sage
Mega Sage

Hi @Randy33 ,

 

Hope you are doing well.

 

I think it should happen OOB please refer the screenshot below when I clicked on new button in the related list the incident number was automatically populated.

 

HarshalAditya_0-1684977812337.png

 

Please mark this response as correct or helpful if it assisted you with your question.

Regards,
Harshal

 

Amit Gujarathi
Giga Sage
Giga Sage

HI @Randy33 ,
I trust you are doing great.

 

To pass the incident number to an incident task when using a related list on a form in ServiceNow, you can follow these steps:

  1. Create a new field on the incident task table to hold the incident number. Let's call it "incident_number" (you can choose a different name if you prefer).

  2. On the incident form, navigate to the related list where you want to pass the incident number (e.g., the incident tasks related list).

  3. Edit the related list properties by right-clicking on the related list header and selecting "Configure > Related List".

  4. In the Related List form, locate the "Reference Qualifier" field and enter the following code:

 

incident.number=javascript:current.number

 

This code sets the reference qualifier for the incident tasks related list to filter the incident tasks based on the current incident number.

  1. Save the related list form and return to the incident form.

Was this answer helpful?


Please consider marking it correct or helpful.


Your feedback helps us improve!


Thank you!


Regards,


Amit Gujrathi