Counting the number of incident tasks related to incident

Naresh291
Tera Contributor

Hi ,

I have a requirment where there is a field called as 'no of incident task' which keeps the count of number of incident task related to an incident .

Was just wondering  is  there any possibility of using Glideaggregate function to get the count of related incident task?

If not can anyone please help me how to achieve this where 'No of incident task' is a field which keeps the track of the count of no of incident task associated with the current incident .

 

Thanks in Advance!

 

 

3 REPLIES 3

Alberto Consonn
ServiceNow Employee
ServiceNow Employee

Hi,

best to do is use the query in a Business Rule to calculate the value as described to the below thread:

https://community.servicenow.com/community?id=community_question&sys_id=f15f72a9db58dbc01dcaf3231f96...

Let me know, it should work fine!

If I have answered your question, please mark my response as correct and/or helpful.

Thank you very much

Cheers
Alberto

Hi Alberto,

Thank you for your quick response .

Is it possible to do through client script ?

Hi,

Yes it is possible to do via OnLoad Client Script and use the Script Include, but, as Alberto Already mentioned that Business Rule is the best way to achieve this.

Why do you want to achieve this via Client Script? Is there any specific business need? Not sure. but The best way is already suggested by Alberto as Business Rule.

You need to have a Business rule on Incident Task table which will update the parent Incident field with the total number of child incident task.

Kindly mark my answer as Correct and helpful based on the Impact

Regards,

Chaitanya