The community will be in read-only from Monday 11:59pm (PT) to Wednesday 7:30am (PT)
The community will be in read-only from Monday 11:59pm (PT) to Wednesday 7:30am (PT)
Service Desk Practitioners Forum
cancel
Showing results for 
Search instead for 
Did you mean: 

How calculate the number of Incidents in relatioship.

SOLVED
Go to solution
Highlighted
RoDrO
Super Collector

How calculate the number of Incidents in relatioship.

Hi all,

I´m implementing Problem Managemnt Process with Service Desk 4.5.

To calculate the Problems´ Priority I need to calculate the number of Incidents in relatioship with the Problem.

Ho can I calculate this number?. How can i put thin on a number field?

Thanks in advanced for your help.

Best Regards,
Rodrigo.
3 REPLIES
Raman Shcharbak
Frequent Visitor

Re: How calculate the number of Incidents in relatioship.

Writing a program using web-api that counts related incidents or Directly querying database using COUNT function. A Rule must run one of these actions.
George M. Meneg
Honored Contributor
Solution

Re: How calculate the number of Incidents in relatioship.

Hello Rodrigo.

You can do it by the means of OVSD. Here's how:

Create a custom number field for problems. Give (preferably through template) initial value 0.

Create a custom boolean fields for incidents. Set it initially to false.

Now create a db rule like this:
when problem is modified and custom number is 99999 then
set custom number to 0
update related incidents boolean to true

Create a db rule for incidents like this:
When an incident is modified an custom boolean is true then
Set custom boolean to false
update related problems custom number to custom number + 1

Now, any time you want to count the number of incidents just set this custom number to 99999. After a while you the number of the related incidents will be there.

You can't do automatically on "relation" because unfortunately you cannot create a trigger this way. So you must use these kinds of workarounds.
menes fhtagn
RoDrO
Super Collector

Re: How calculate the number of Incidents in relatioship.

Thanks a lot George and Roman.
//Add this to "OnDomLoad" event