Prozessmanagement

Nach der Installation des Pakets werden fünf neue Module für Skript-Task-Aktivitäten und Sequenzfluss-Aktionen des Prozessmanagements hinzugefügt.

Prozessmodule

So sehen Sie die neuen Module:

  1. Gehen Sie im Administrator-Interface zur Ansicht Prozessverwaltung.

  2. Erstellen Sie einen neuen Prozess oder wählen Sie einen bestehenden Prozess aus, der eine Skript-Task-Aktivität enthält.

  3. Klicken Sie auf den Eintrag Aktivitäten im Widget Verfügbare Prozesselemente in der linken Seitenleiste.

  4. Erstellen Sie eine neue Skript-Task-Aktivität oder bearbeiten Sie eine bestehende.

  5. Wählen Sie eines der neuen Skripte im Dropdown Script.

    • ITSMConfigItemDataPull

    • ITSMConfigItemDataPush

    • LinkWithITSMConfigItem

    • TicketLinkITSMConfigItem

    • TicketUpdateByLinkedCI

  6. Klicken Sie auf die Schaltfläche Speichern, wenn die Schaltfläche Konfigurieren neben der Dropdown-Liste Script nicht sichtbar ist.

  7. Klicken Sie auf die Schaltfläche Konfigurieren, um Parameter (Schlüssel-Werte-Paare) für das Skript hinzuzufügen.

ITSMConfigItemDataPull

Ein Modul zum Abrufen von Daten aus einem verknüpften ITSM Configuration Item.

Prozessmanagement-Modul „ITSMConfigItemDataPull“

Prozessmanagement-Modul „ITSMConfigItemDataPull“

Hauptsektion der Suchparameter

Die folgenden Parameter können für Einschränkungen verwendet werden:

  • Klasse *

  • Verwendungsstatus

  • Vorfallstatus

  • Verknüpfungstyp

Zusätzlicher Abschnitt über die Bedingungen des Configuration Items

In diesem Abschnitt können Sie nach Configuration Items suchen.

Filter können mit Schlüssel-Werte-Paaren hinzugefügt werden. Es besteht eine logische UND-Beziehung zwischen den Filtern, wenn mehr als ein Filter hinzugefügt wird. Die logische ODER-Verknüpfung kann durch mehrere durch , getrennte Werte hinzugefügt werden.

Der Schlüssel Limit begrenzt die Anzahl der zurückgegebenen Configuration Items.

Abschnitt „Gewünschtes Verhalten“

Wenn im obigen Abschnitt mehrere Configuration Items zu finden sind, kann hier das gewünschte Verhalten definiert werden.

Mögliche Werte:

  • Attribute aus dem zuerst gefundenen Configuration Item kopieren

  • Kopieren Sie die Attribute aus dem zuletzt gefundenen Configuration Item

  • Configuration Item ignorieren, nichts kopieren

Abschnitt „Attribute des Prozesstickets“

Mit diesem Modul können die Attribute des Prozesstickets aktualisiert werden. Der Schlüssel ist das Attribut des Prozesstickets. Der Wert kann ein vordefinierter Text, ein Attribut aus dem verknüpften Configuration Item in Form eines OTRS-Tags oder eine Verkettung von beidem sein. Das OTRS-Tag-Präfix <OTRS_ITSMCI_*> kann hier verwendet werden.

Beispiele:

Schlüssel

Wert

Priority

5 very high

DynamicField_Capacity

<OTRS_ITSMCI_HardDisk::Capacity::1>

Title

From: <OTRS_ITSMCI_Name>

Siehe auch

Schauen Sie in der ITSMConfigItemDataPull und der ConfigItemSearch() API-Referenz.

ITSMConfigItemDataPush

Ein Modul zum Einfügen von Daten in ein verknüpftes ITSM Configuration Item.

Prozessmanagement-Modul „ITSMConfigItemDataPush“

Prozessmanagement-Modul „ITSMConfigItemDataPush“

Hauptsektion der Suchparameter

Die folgenden Parameter können für Einschränkungen verwendet werden:

  • Klasse *

  • Verwendungsstatus

  • Vorfallstatus

  • Verknüpfungstyp

Zusätzlicher Abschnitt über die Bedingungen des Configuration Items

In diesem Abschnitt können Sie nach Configuration Items suchen.

Filter können mit Schlüssel-Werte-Paaren hinzugefügt werden. Es besteht eine logische UND-Beziehung zwischen den Filtern, wenn mehr als ein Filter hinzugefügt wird. Die logische ODER-Verknüpfung kann durch mehrere durch , getrennte Werte hinzugefügt werden.

Der Schlüssel Limit begrenzt die Anzahl der zurückgegebenen Configuration Items.

Abschnitt „Verknüpfte Configuration Item-Attribute“

Hier können die zu aktualisierenden Attribute des verknüpften Configuration Items festgelegt werden. Der Schlüssel ist das Attribut des verknüpften Configuration Items. Der Wert kann ein vordefinierter Text, ein Attribut aus dem Prozessticket in Form eines OTRS-Tags oder eine Verkettung von beidem sein. Das OTRS-Tag-Präfix <OTRS_TICKET_*> kann hier verwendet werden.

Beispiele:

Schlüssel

Wert

ConfigItemCreateTimeNewerDate

2021-10-20 12:23:34

HardDisk::Capacity::1

<OTRS_TICKET_DynamicField_HDCapacity>

Name

Process: <OTRS_TICKET_DynamicField_ProcessManagementProcessID>

Siehe auch

Schauen Sie in der ITSMConfigItemDataPull und der ConfigItemSearch() API-Referenz.

LinkWithITSMConfigItem

Ein Modul zur Verknüpfung von ITSM Configuration Items.

Prozessmanagement-Modul „LinkWithITSMConfigItem“

Prozessmanagement-Modul „LinkWithITSMConfigItem“

Hauptsektion der Suchparameter

Die folgenden Parameter können für Einschränkungen verwendet werden:

  • Klasse *

  • Verwendungsstatus

  • Vorfallstatus

  • Verknüpfungstyp

Zusätzlicher Abschnitt über die Bedingungen des Configuration Items

In diesem Abschnitt können Sie nach Configuration Items suchen.

Filter können mit Schlüssel-Werte-Paaren hinzugefügt werden. Es besteht eine logische UND-Beziehung zwischen den Filtern, wenn mehr als ein Filter hinzugefügt wird. Die logische ODER-Verknüpfung kann durch mehrere durch , getrennte Werte hinzugefügt werden.

Der Schlüssel Limit begrenzt die Anzahl der zurückgegebenen Configuration Items.

Siehe auch

Schauen Sie in der LinkWithITSMConfigItem und der ConfigItemSearch() API-Referenz.

TicketLinkITSMConfigItem

Ein Modul zur Durchführung einer erweiterten Configuration Item-Suche und zur Verknüpfung von Suchergebnissen mit Tickets.

Prozessmanagement-Modul „ TicketLinkITSMConfigItem“

Prozessmanagement-Modul „ TicketLinkITSMConfigItem“

Hauptsektion der Suchparameter

Die folgenden Parameter können für Einschränkungen verwendet werden:

  • Klasse *

  • Verwendungsstatus

  • Vorfallstatus

  • Verknüpfungstyp

Zusätzlicher Abschnitt über die Bedingungen des Configuration Items

In diesem Abschnitt können Sie nach Configuration Items suchen.

Filter können mit Schlüssel-Werte-Paaren hinzugefügt werden. Es besteht eine logische UND-Beziehung zwischen den Filtern, wenn mehr als ein Filter hinzugefügt wird. Die logische ODER-Verknüpfung kann durch mehrere durch , getrennte Werte hinzugefügt werden.

Sie können die Suchergebnisse sortieren, wenn Sie den Schlüssel OrderBy und das Attribut eines Configuration Items als Wert angeben.

Sie können die Sortierreihenfolge mit dem Schlüssel OrderByDirection und den Werten Up oder Down beeinflussen.

Wenn keine Sortierung angegeben wird, erfolgt die Sortierung automatisch in absteigender Reihenfolge anhand der ID der Configuration Items.

Siehe auch

Schauen Sie in der TicketLinkITSMConfigItem und der ConfigItemSearch() API-Referenz.

TicketUpdateByLinkedCI

Ein Modul zum Festlegen von Ticket-Attributen basierend auf einem verknüpften Configuration Item.

Prozessmanagement-Modul „TicketUpdateByLinkedCI“

Prozessmanagement-Modul „TicketUpdateByLinkedCI“

Hauptsektion der Suchparameter

Die folgenden Parameter können für Einschränkungen verwendet werden:

  • Klasse

  • Verwendungsstatus

  • Vorfallstatus

  • Verknüpfungstyp

Abschnitt „Gewünschtes Verhalten“

Wenn im obigen Abschnitt mehrere Configuration Items zu finden sind, kann hier das gewünschte Verhalten definiert werden.

Mögliche Werte:

  • Attribute aus dem zuerst gefundenen Configuration Item kopieren

  • Kopieren Sie die Attribute aus dem zuletzt gefundenen Configuration Item

  • Configuration Item ignorieren, nichts kopieren

Zuordnung eines Configuration Items zu einem Ticket-Bereich

Mit diesem Modul können die Attribute des Configuration Items auf Ticket-Attribute abgebildet werden. Der Schlüssel ist das Attribut des Configuration Items. Der Wert ist das Attribut des Tickets.

Beispiele:

Schlüssel

Wert

HardDisk::Capacity

DynamicField_HDCapacity

Name

Title

Siehe auch

Schauen Sie in der TicketUpdateByLinkedCI und der ConfigItemSearch() API-Referenz.

API-Referenz

Diese API-Referenzen sind nicht online verfügbar, aber sie sind in diesem Handbuch enthalten.

ITSMConfigItemDataPull API

NAME

Kernel::System::ProcessManagement::Modules::ITSMConfigItemDataPull - A module to fetch data from a linked ITSM configuration item.

DESCRIPTION

All ITSMConfigItemDataPull functions.

PUBLIC INTERFACE

new()

Don't use the constructor directly, use the ObjectManager instead:

    my $ITSMConfigItemDataPullObject = $Kernel::OM->Get('Kernel::System::ProcessManagement::Modules::ITSMConfigItemDataPull');

Run()

Run Data

my $Success = $ITSMConfigItemDataPullObject->Run(
    UserID                          => 123,
    Ticket                          => \%Ticket,  # required
    ProcessEntityID                 => 'P123',
    ActivityEntityID                => 'A123',
    SequenceFlowEntityID            => 'T123',
    SequenceFlowActionEntityID      => 'TA123',
    Config => {

        ConfigITSMConfigItemSearch => {
            ClassIDs     => [9, 8, 7, 6],             # (optional)
            DeplStateIDs => [1, 2, 3, 4],             # (optional)
            InciStateIDs => [1, 2, 3, 4],             # (optional)
            LinkType     => 'RelevantTo::Source',     # (optional)
        },

        ConfigSearchKeyValueList => {
            Name         => 'The Name',               # (optional)

            # configuration items with created time after ...
            ConfigItemCreateTimeNewerDate => '2006-01-09 00:00:01',  # (optional)
            # configuration items with created time before then ....
            ConfigItemCreateTimeOlderDate => '2006-01-19 23:59:59',  # (optional)

            # configuration items with changed time after ...
            ConfigItemChangeTimeNewerDate => '2006-01-09 00:00:01',  # (optional)
            # configuration items with changed time before then ....
            ConfigItemChangeTimeOlderDate => '2006-01-19 23:59:59',  # (optional)

            # XML attributes (defined by class)
            'ElementA::ElementB' => '%contentA%',
            'ElementA::ElementB' => '%contentC%,%contentD%,%contentE%,
        }.

        UserID => 123,     # optional,to override the UserID from the logged user

        ConfigDropdown => {
            Behavior => 'NoCopy',       #  'NoCopy', 'CopyFirstLinked' or 'CopyLastLinked' only
        },

        UserID => 123,     # optional,to override the UserID from the logged user

        # Value set:
        #   * Key is the attribute of the linked ITSM configuration item where the data will be set,
        #   * Value is the value is the value to be set, supporting smart tags <OTRS_ITSMCI_*> from the resulting linked
        #       configuration item after match and behavior filters
        #
        #   Example:
        #   * To set process ticket title to be exactly the linked configuration item first element of field someDefinitionField::Sub
        #     Title => '<OTRS_ITSMCI_someDefinitionField::Sub::1>',
        #     where 'Sub' is a sub field of field 'someDefinitionField'
        #   * To set process ticket title to be exactly the linked configuration item second element of field someDefinitionField
        #     Title => '<OTRS_ITSMCI_someDefinitionField2::2>',
        #   * To set the process ticket dynamic field NameX to an static value (not real pull):
        #     DynamicField_NameX => 'someValue',
    }
);

- `Ticket` contains the result of TicketGet including DynamicFields.

ITSMConfigItemDataPush API

NAME

Kernel::System::ProcessManagement::Modules::ITSMConfigItemDataPush - A module to insert data to a linked ITSM configuration items.

DESCRIPTION

All ITSMConfigItemDataPush functions.

PUBLIC INTERFACE

new()

Don't use the constructor directly, use the ObjectManager instead:

    my $ITSMConfigItemDataPushObject = $Kernel::OM->Get('Kernel::System::ProcessManagement::Modules::ITSMConfigItemDataPush');

Run()

Run Data

my $Success = $ITSMConfigItemDataPullObject->Run(
    UserID                          => 123,
    Ticket                          => \%Ticket,  # required
    ProcessEntityID                 => 'P123',
    ActivityEntityID                => 'A123',
    SequenceFlowEntityID            => 'T123',
    SequenceFlowActionEntityID      => 'TA123',
    Config => {

        ConfigITSMConfigItemSearch => {
            ClassIDs     => [9, 8, 7, 6],             # (optional)
            DeplStateIDs => [1, 2, 3, 4],             # (optional)
            InciStateIDs => [1, 2, 3, 4],             # (optional)
            LinkType     => 'RelevantTo::Source',     # (optional)
        },

        ConfigSearchKeyValueList => {
            Name         => 'The Name',               # (optional)

            # configuration items with created time after ...
            ConfigItemCreateTimeNewerDate => '2006-01-09 00:00:01',  # (optional)
            # configuration items with created time before then ....
            ConfigItemCreateTimeOlderDate => '2006-01-19 23:59:59',  # (optional)

            # configuration items with changed time after ...
            ConfigItemChangeTimeNewerDate => '2006-01-09 00:00:01',  # (optional)
            # configuration items with changed time before then ....
            ConfigItemChangeTimeOlderDate => '2006-01-19 23:59:59',  # (optional)

            # XML attributes (defined by class)
            'ElementA::ElementB' => '%contentA%',
            'ElementA::ElementB' => '%contentC%,%contentD%,%contentE%,
        }.

        UserID => 123,     # optional,to override the UserID from the logged user

        ConfigDropdown => {
            Behavior => 'NoCopy',       #  'NoCopy', 'CopyFirstLinked' or 'CopyLastLinked' only
        },

        UserID => 123,     # optional,to override the UserID from the logged user

        # Value set:
        #   * Key is the attribute of the linked ITSM configuration items where the data will be pushed,
        #   * Value is the value is the value to be set, supporting smart tags <OTRS_TICKET_*> from the current process ticket e.g.
        #
        #   Example:
        #   * To set linked ITSM configuration items first element of someDefinitionField::Sub to be exactly the process ticket QueueID:
        #     'someDefinitionField::Sub::1' => '<OTRS_Ticket_QueueID>',
        #      Where 'Sub' is a sub field of 'someDefinitionField' field
        #   * To set linked ITSM configuration items second element of someDefinitionField2 to be the concatenation of
        #     some text and the content of the process ticket dynamic field ExternalField2:
        #     'someDefinitionField2::2' => 'Some text <OTRS_Ticket_DynamicField_ExternalField2>',
        #   * To set linked ITSM configuration items last element of someDefinitionField::Sub to be an static text:
        #     'someDefinitionField::Sub' => 'Some text',
    }
);

- `Ticket` contains the result of TicketGet including DynamicFields.

LinkWithITSMConfigItem API

NAME

Kernel::System::ProcessManagement::Modules::LinkWithITSMConfigItem - A module to link ITSM configuration items.

DESCRIPTION

All LinkWithITSMConfigItem functions.

PUBLIC INTERFACE

new()

Don't use the constructor directly, use the ObjectManager instead:

    my $LinkWithITSMConfigItemObject = $Kernel::OM->Get('Kernel::System::ProcessManagement::Modules::LinkWithITSMConfigItem');

Run()

Run Data

my $Success = $LinkWithITSMConfigItem->Run(
    UserID                          => 123,
    Ticket                          => \%Ticket,  # required
    ProcessEntityID                 => 'P123',
    ActivityEntityID                => 'A123',
    SequenceFlowEntityID            => 'T123',
    SequenceFlowActionEntityID      => 'TA123',
    Config => {

        ConfigITSMConfigItemSearch => {
            ClassIDs     => [9, 8, 7, 6],             # (optional)
            DeplStateIDs => [1, 2, 3, 4],             # (optional)
            InciStateIDs => [1, 2, 3, 4],             # (optional)
            LinkType     => 'RelevantTo::Source',     # (optional)
        },

        ConfigSearchKeyValueList => {
            Number       => 'The ConfigItem Number',  # (optional)
            Name         => 'The Name',               # (optional)

            # configuration items with created time after ...
            ConfigItemCreateTimeNewerDate => '2006-01-09 00:00:01',  # (optional)
            # configuration items with created time before then ....
            ConfigItemCreateTimeOlderDate => '2006-01-19 23:59:59',  # (optional)

            # configuration items with changed time after ...
            ConfigItemChangeTimeNewerDate => '2006-01-09 00:00:01',  # (optional)
            # configuration items with changed time before then ....
            ConfigItemChangeTimeOlderDate => '2006-01-19 23:59:59',  # (optional)

            # XML attributes (defined by class)
            'ElementA::ElementB' => '%contentA%',
            'ElementA::ElementB' => '%contentC%,%contentD%,%contentE%,
        }.

        UserID => 123,     # optional,to override the UserID from the logged user
    }
);

- `Ticket` contains the result of TicketGet including DynamicFields.

TicketLinkITSMConfigItem API

NAME

Kernel::System::ProcessManagement::Modules::TicketLinkITSMConfigItem - A module to perform an extended configuration item search and link search results to ticket.

DESCRIPTION

All TicketLinkITSMConfigItem functions.

PUBLIC INTERFACE

new()

Don't use the constructor directly, use the ObjectManager instead:

    my $TicketLinkITSMConfigItemObject = $Kernel::OM->Get('Kernel::System::ProcessManagement::Modules::TicketLinkITSMConfigItem');

Run()

Run Data

my $Success = $TicketLinkITSMConfigItemObject->Run(
    UserID                          => 123,
    Ticket                          => \%Ticket,   # required
    ProcessEntityID                 => 'P123',
    ActivityEntityID                => 'A123',
    SequenceFlowEntityID            => 'T123',
    SequenceFlowActionEntityID      => 'TA123',
    Config => {
        UserID                      => 123,         # optional, to override the UserID from the logged user
    }
);

- `Ticket` contains the result of TicketGet including DynamicFields.
- `Config` is the Config Hash stored in a Process::SequenceFlowAction's Config key.

TicketUpdateByLinkedCI API

NAME

Kernel::System::ProcessManagement::Modules::TicketUpdateByLinkedCI - A module to set ticket attributes based on a linked configuration item.

DESCRIPTION

All TicketUpdateByLinkedCI functions.

PUBLIC INTERFACE

new()

Don't use the constructor directly, use the ObjectManager instead:

my $TicketUpdateByLinkedCIObject = $Kernel::OM->Get('Kernel::System::ProcessManagement::Modules::TicketUpdateByLinkedCI');

Run()

Run Data

my $Success = $TicketUpdateByLinkedCIObject->Run(
    UserID                          => 123,
    Ticket                          => \%Ticket,                    # required
    ProcessEntityID                 => 'P123',
    ActivityEntityID                => 'A123',
    SequenceFlowEntityID            => 'T123',
    SequenceFlowActionEntityID      => 'TA123',
    Config  => {
        ConfigITSMConfigItemSearch => {
            ClassID                 => 123,                         # optional
            DeplStateIDs            => [123],                       # optional
            InciStateIDs            => [123],                       # optional
            LinkType                => 'someType::someDirection',   # optional
        },
        ConfigDropdown => {
            Behavior                => 'NoCopy',                    # 'CopyFirstLinked', 'CopyLastLinked'
        },
        'someDefinitionField::Sub'  => 'DynamicField_someName',     # example optional
        'someDefinitionField2'      => 'someTicketAttribute',       # example optional
        UserID                      => 123,                         # optional, to override the UserID from the logged user
    }
);

- `Ticket` contains the result of TicketGet including DynamicFields.
- `Config` is the Config Hash stored in a Process::SequenceFlowAction's Config key.

ConfigItemCreate() API

perform ConfigItemCreate Operation. This will return the created config item number.

 my $Result = $OperationObject->Run(
     Data => {
         UserLogin         => 'some agent login',            # UserLogin or AccessToken is required
         AccessToken       => 'eyJhbGciOiJIUzI1NiJ9[...],'

         Password  => 'some password',                   # if UserLogin is sent then
                                                         #   Password is required
         ConfigItem => {
             Number       => '111',                      # optional
             Class        => 'Configuration Item Class',
             Name         => 'The Name',
             DeplState    => 'deployment state',
             InciState    => 'incident state',
             CIXMLData    => $ArrayHashRef,              # it depends on the Configuration Item class and definition

             Attachment => [
                 {
                     Content     => 'content'            # base64 encoded
                     ContentType => 'some content type'
                     Filename    => 'some fine name'
                 },
                 # ...
             ],
             #or
             #Attachment => {
             #    Content     => 'content'
             #    ContentType => 'some content type'
             #    Filename    => 'some fine name'
             #},
         },
     },
 );

 $Result = {
     Success         => 1,                       # 0 or 1
     ErrorMessage    => '',                      # in case of error
     Data            => {                        # result data payload after Operation
         ConfigItemID => 123,                    # Configuration Item  ID number in OTRS::ITSM (Service desk system)
         Number       => 2324454323322           # Configuration Item  Number in OTRS::ITSM (Service desk system)
         Error => {                              # should not return errors
                 ErrorCode    => 'ConfigItemCreate.ErrorCode'
                 ErrorMessage => 'Error Description'
         },
     },
 };

ConfigItemDelete() API

perform ConfigItemDelete Operation. This function is able to return
one or more ConfigItem entries in one call.

 my $Result = $OperationObject->Run(
     Data => {
         UserLogin         => 'some agent login',            # UserLogin or CustomerUserLogin or AccessToken is
                                                             # required
         CustomerUserLogin => 'some customer login',
         AccessToken       => 'eyJhbGciOiJIUzI1NiJ9[...]',

         Password          => 'some password',               # if UserLogin or customerUserLogin is sent then
                                                             #   Password is required
         ConfigItemID      => '32,33',                       # required, could be coma separated IDs or an Array
     },
 );

 $Result = {
     Success         => 1,                       # 0 or 1
     ErrorMessage    => '',                      # in case of error
     Data            => {                        # result data payload after Operation
         ConfigItemID => [123, 456],         # Configuration Item IDs number in OTRS::ITSM (Service desk system)
         Error => {                              # should not return errors
                 ErrorCode    => 'ConfigItemDelete.ErrorCode'
                 ErrorMessage => 'Error Description'
         },
     },
 };

ConfigItemGet() API

perform ConfigItemGet Operation. This function is able to return
one or more ConfigItem entries in one call.

 my $Result = $OperationObject->Run(
     Data => {
         UserLogin         => 'some agent login',            # UserLogin or AccessToken is
         AccessToken       => 'eyJhbGciOiJIUzI1NiJ9[...]',   # required
         Password          => 'some password',               # if UserLogin is sent then Password is required
         ConfigItemID      => '32,33',                       # required, could be coma separated IDs or an Array
         Attachments       => 1,                             # Optional, 1 as default. If it's set with the value 1,
                                                             # attachments for articles will be included on ConfigItem data
     },
 );

 $Result = {
     Success      => 1,                                # 0 or 1
     ErrorMessage => '',                               # In case of an error
     Data         => {
         ConfigItem => [
             {

                 Number             => '20101027000001',
                 ConfigItemID       => 123,
                 Name               => 'some name',
                 Class              => 'some class',
                 VersionID          => 123,
                 LastVersionID      => 123,
                 DefinitionID       => 123,
                 InciState          => 'some incident state',
                 InciStateType      => 'some incident state type',
                 DeplState          => 'some deployment state',
                 DeplStateType      => 'some deployment state type',
                 CurInciState       => 'some incident state',
                 CurInciStateType   => 'some incident state type',
                 CurDeplState       => 'some deployment state',
                 CurDeplStateType   => 'some deployment state type',
                 CreateTime         => '2010-10-27 20:15:00'
                 CreateBy           => 123,
                 CIXMLData          => $XMLDataHashRef,

                 Attachment => [
                     {
                         Content            => "xxxx",     # actual attachment contents, base64 enconded
                         ContentType        => "application/pdf",
                         Filename           => "StdAttachment-Test1.pdf",
                         Filesize           => "4.6 KBytes",
                         Preferences        => $PreferencesHashRef,
                     },
                     {
                         # . . .
                     },
                 ],
             },
             {
                 # . . .
             },
         ],
     },
 };

ConfigItemSearch() API

ConfigItemSearch()

return a configuration item list as an array reference

my $ConfigItemIDs = $ConfigItemObject->ConfigItemSearch(
    Number       => 'The ConfigItem Number',  # (optional)
    ClassIDs     => [9, 8, 7, 6],             # (optional)
    DeplStateIDs => [1, 2, 3, 4],             # (optional)
    InciStateIDs => [1, 2, 3, 4],             # (optional)
    CreateBy     => [1, 2, 3],                # (optional)
    ChangeBy     => [3, 2, 1],                # (optional)

    # configuration items with created time after ...
    ConfigItemCreateTimeNewerDate => '2006-01-09 00:00:01',  # (optional)
    # configuration items with created time before then ....
    ConfigItemCreateTimeOlderDate => '2006-01-19 23:59:59',  # (optional)

    # configuration items with changed time after ...
    ConfigItemChangeTimeNewerDate => '2006-01-09 00:00:01',  # (optional)
    # configuration items with changed time before then ....
    ConfigItemChangeTimeOlderDate => '2006-01-19 23:59:59',  # (optional)

    OrderBy => [ 'ConfigItemID', 'Number' ],                  # (optional)
    # default: [ 'ConfigItemID' ]
    # (ConfigItemID, Number, ClassID, DeplStateID, InciStateID,
    # CreateTime, CreateBy, ChangeTime, ChangeBy)

    # Additional information for OrderBy:
    # The OrderByDirection can be specified for each OrderBy attribute.
    # The pairing is made by the array indices.

    OrderByDirection => [ 'Down', 'Up' ],                    # (optional)
    # default: [ 'Down' ]
    # (Down | Up)

    Limit          => 122,  # (optional)
    UsingWildcards => 0,    # (optional) default 1
);
ConfigItemSearchExtended()

return a configuration item list as an array reference

my $ConfigItemIDs = $ConfigItemObject->ConfigItemSearchExtended(
    Number       => 'The ConfigItem Number',  # (optional)
    Name         => 'The Name',               # (optional)
    ClassIDs     => [9, 8, 7, 6],             # (optional)
    DeplStateIDs => [1, 2, 3, 4],             # (optional)
    InciStateIDs => [1, 2, 3, 4],             # (optional)

    # configuration items with created time after ...
    ConfigItemCreateTimeNewerDate => '2006-01-09 00:00:01',  # (optional)
    # configuration items with created time before then ....
    ConfigItemCreateTimeOlderDate => '2006-01-19 23:59:59',  # (optional)

    # configuration items with changed time after ...
    ConfigItemChangeTimeNewerDate => '2006-01-09 00:00:01',  # (optional)
    # configuration items with changed time before then ....
    ConfigItemChangeTimeOlderDate => '2006-01-19 23:59:59',  # (optional)

    What => [                                                # (optional)
        # each array element is a and condition
        {
            # or condition in hash
            "[%]{'ElementA'}[%]{'ElementB'}[%]{'Content'}" => '%contentA%',
            "[%]{'ElementA'}[%]{'ElementC'}[%]{'Content'}" => '%contentA%',
        },
        {
            "[%]{'ElementA'}[%]{'ElementB'}[%]{'Content'}" => '%contentB%',
            "[%]{'ElementA'}[%]{'ElementC'}[%]{'Content'}" => '%contentB%',
        },
        {
            # use array reference if different content with same key was searched
            "[%]{'ElementA'}[%]{'ElementB'}[%]{'Content'}" => ['%contentC%', '%contentD%', '%contentE%'],
            "[%]{'ElementA'}[%]{'ElementC'}[%]{'Content'}" => ['%contentC%', '%contentD%', '%contentE%'],
        },
    ],

    PreviousVersionSearch => 1,  # (optional) default 0 (0|1)

    OrderBy => [ 'ConfigItemID', 'Number' ],                  # (optional)
    # default: [ 'ConfigItemID' ]
    # (ConfigItemID, Number, Name, ClassID, DeplStateID, InciStateID,
    # CreateTime, CreateBy, ChangeTime, ChangeBy)

    # Additional information for OrderBy:
    # The OrderByDirection can be specified for each OrderBy attribute.
    # The pairing is made by the array indices.

    OrderByDirection => [ 'Down', 'Up' ],                    # (optional)
    # default: [ 'Down' ]
    # (Down | Up)

    Limit          => 122,  # (optional)
    UsingWildcards => 0,    # (optional) default 1
);

ConfigItemUpdate() API

perform ConfigItemUpdate Operation. This will return the updated configuration item number.

 my $Result = $OperationObject->Run(
     Data => {
         UserLogin => 'some agent login',                # UserLogin or AccessToken is
         AccessToken => 123,                             # required

         Password  => 'some password',                   # if UserLogin is sent then Password is required

         ReplaceExistingData => 0,                       # optional, 0 or 1, default 0
                                                         # this will replace the existing XML data and attachments
         ConfigItemID => 123,

         ConfigItem   => {
             Class     => 'Configuration Item Class',
             Name      => 'The Name',
             DeplState => 'deployment state',
             InciState => 'incident state',
             CIXMLData => $ArrayHashRef,                 # it depends on the Configuration Item class and definition

             Attachment => [
                 {
                     Content     => 'content'            # base64 encoded
                     ContentType => 'some content type'
                     Filename    => 'some fine name'
                 },
                 # ...
             ],
             # or
             #Attachment => {
             #   Content     => 'content'
             #   ContentType => 'some content type'
             #   Filename    => 'some fine name'
             #},
         },
     },
 );

 $Result = {
     Success         => 1,                       # 0 or 1
     ErrorMessage    => '',                      # in case of error
     Data            => {                        # result data payload after Operation
         ConfigItemID => 123,                    # Configuration Item  ID number in OTRS::ITSM (Service desk system)
         Number       => 2324454323322           # Configuration Item  Number in OTRS::ITSM (Service desk system)
         Error => {                              # should not return errors
                 ErrorCode    => 'ConfigItemUpdate.ErrorCode'
                 ErrorMessage => 'Error Description'
         },
     },
 };
Nach oben scrollen