Quantcast
Channel: Ivanti User Community: Message List
Viewing all articles
Browse latest Browse all 13696

Parent incident in calculation

$
0
0

Hi,

 

I was asked to show on dashbord where all running incidents are, parent incident ID, if exists.

So, I created attribute int 32 called parent, and now trying to calculate parent ID.

My calculation (created based on this thread) is:

 

import System

static def GetAttributeValue(Incident):

    if Incident.Parents.Latest()!= null:

        for ParentLink in Incident.Parents:

            ParentIncident = ParentLink.Parent

        Value = ParentIncident._Id

    return Value

 

il log file:

Calculation

Attribute Calculation Successful at 2013-07-02 00:18:05.791

Calculation successful for Attribute [_parent] on Class Type [IncidentManagement.Incident]

On Object : Key = [001d80ed-xxxx-xxxx-xxxx-xxxxxxxxx]  Name = [2013010028]

Calculated Value = []

INFORMATION

 

Calculation successful, but nothing returned... Where I'm wrong?

 

My first calculation was:

 

import System

static def GetAttributeValue(Incident):

     Latestparent = Incident.Parents.Latest()

     Value = Latestparent._Id

return Value

 

But as is stated in thread mentioned above Latest() function cannot be used with parent/child collection... I'm stuck...


Viewing all articles
Browse latest Browse all 13696


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>