6 Replies Latest reply on May 9, 2016 9:38 PM by Axell

    Setting a Prefix for the 'Process Ref' attribute in Queries

    Apprentice

      Issue:

       

      Setting a Prefix for the 'Process Ref' attribute when using Queries to distingush between Incident, Problems, Changes, Request, and other modules

       

      However there are some modules that do not contain a prefix which will give you a double colon with an ID number when using the 'Process Ref' Attribute, such as request Management

       

      LDSD Change:

       

      In LANDesk Service Desk 7.3.x and above calculations have removed the need for the Trigger to insert a value before the ID# on an IPC.  With this change a calculation has been added to the following:

       

      Module:  Process Management

      Object: Process

      Attribute: Process Ref

       

      Calculation: 'After Read'

       

      import System

      static def GetAttributeValue(Process):

      ClassType = Process.Class.Name

      Prefix=''

      if ClassType == 'Incident':

      Prefix='I'

      if ClassType == 'Problem':

      Prefix='P'

      if ClassType == 'Change':

      Prefix='C'

      if ClassType == 'Task':

      Prefix='T'

      if ClassType == 'Call':

      Prefix='c'

      if ClassType == 'Activity':

      Prefix='H'

      return String.Format("{0}:{1}", Prefix, Process.Id)

       

      Resolution:

       

      Browse out to the 'Process Ref' attribute and modify the calculation to include as an example the Request Management Module:

       

      if ClassType == 'Request':
        Prefix='R'

       

      I have also attached a .txt document which you can copy and paste or just copy and paste one line and modify as needed.

       

      LDSD Version:

       

      7.3.x and above