Process Management

After installation of the package five new modules are added to script task activities and sequence flow actions of process management.

Process Modules

To see the new modules:

  1. Go to the Process Management screen of the administrator interface.

  2. Create a new process or select an existing process that contains a script task activity.

  3. Click on the Activities item in the Available Process Elements widget in the left sidebar.

  4. Create a new script task activity or edit an existing one.

  5. Select one of the new scripts in the Script drop-down.

    • ITSMConfigItemDataPull

    • ITSMConfigItemDataPush

    • LinkWithITSMConfigItem

    • TicketLinkITSMConfigItem

    • TicketUpdateByLinkedCI

  6. Click on the Save button, if the Configure button is not visible next to the Script drop-down.

  7. Click on the Configure button to add parameters (key-value pairs) for the script.

ITSMConfigItemDataPull

A module to fetch data from a linked ITSM configuration item.

Process Management Module ITSMConfigItemDataPull

Process Management Module ITSMConfigItemDataPull

Main search parameters section

The following parameters can be used for restrictions:

  • Class *

  • Deployment State

  • Incident State

  • Link Type

Additional configuration item condition section

This section is used to search for configuration items.

Filters can be added with key-value pairs. There is logical AND relation between the filters if more than one filter is added. Logical OR relation can be added by multiple values separated by ,.

The key Limit limits the number of configuration items returned.

Desired behavior section

If more than one configuration items are found in the section above, the desired behavior can be defined here.

Possible values:

  • Copy attributes from the configuration item that was found first

  • Copy attributes from the configuration item that was found last

  • Ignore configuration item, do not copy anything

Process ticket attributes section

With this module the process ticket attributes can be updated. The key is the attribute of the process ticket. The value can be a pre-defined text, an attribute from the linked configuration item in form of an OTRS tag or a concatenation of both. The <OTRS_ITSMCI_*> OTRS tag prefix can be used here.

Examples:

Key

Value

Priority

5 very high

DynamicField_Capacity

<OTRS_ITSMCI_HardDisk::Capacity::1>

Title

From: <OTRS_ITSMCI_Name>

See also

See the ITSMConfigItemDataPull and the ConfigItemSearch() API reference.

ITSMConfigItemDataPush

A module to insert data to a linked ITSM configuration items.

Process Management Module ITSMConfigItemDataPush

Process Management Module ITSMConfigItemDataPush

Main search parameters section

The following parameters can be used for restrictions:

  • Class *

  • Deployment State

  • Incident State

  • Link Type

Additional configuration item condition section

This section is used to search for configuration items.

Filters can be added with key-value pairs. There is logical AND relation between the filters if more than one filter is added. Logical OR relation can be added by multiple values separated by ,.

The key Limit limits the number of configuration items returned.

Linked configuration item attributes section

Here can be set the linked configuration item attributes to be updated. The key is the attribute of the linked configuration item. The value can be a pre-defined text, an attribute from the process ticket in form of an OTRS tag or a concatenation of both. The <OTRS_TICKET_*> OTRS tag prefix can be used here.

Examples:

Key

Value

ConfigItemCreateTimeNewerDate

2021-10-20 12:23:34

HardDisk::Capacity::1

<OTRS_TICKET_DynamicField_HDCapacity>

Name

Process: <OTRS_TICKET_DynamicField_ProcessManagementProcessID>

See also

See the ITSMConfigItemDataPush and the ConfigItemSearch() API reference.

LinkWithITSMConfigItem

A module to link ITSM configuration items.

Process Management Module LinkWithITSMConfigItem

Process Management Module LinkWithITSMConfigItem

Main search parameters section

The following parameters can be used for restrictions:

  • Class *

  • Deployment State

  • Incident State

  • Link Type

Additional configuration item condition section

This section is used to search for configuration items.

Filters can be added with key-value pairs. There is logical AND relation between the filters if more than one filter is added. Logical OR relation can be added by multiple values separated by ,.

The key Limit limits the number of configuration items returned.

See also

See the LinkWithITSMConfigItem and the ConfigItemSearch() API reference.

TicketLinkITSMConfigItem

A module to perform an extended configuration item search and link search results to ticket.

Process Management Module TicketLinkITSMConfigItem

Process Management Module TicketLinkITSMConfigItem

Main search parameters section

The following parameters can be used for restrictions:

  • Class *

  • Deployment State

  • Incident State

  • Link Type

Additional configuration item condition section

This section is used to search for configuration items.

Filters can be added with key-value pairs. There is logical AND relation between the filters if more than one filter is added. Logical OR relation can be added by multiple values separated by ,.

You can sort the search results if you specify the key OrderBy and the attribute of a configuration item as value.

You can influence the sorting order with the key OrderByDirection and the values Up or Down.

If no sorting is specified, sorting is performed automatically in descending order based on the ID of the configuration items.

See also

See the TicketLinkITSMConfigItem and the ConfigItemSearch() API reference.

TicketUpdateByLinkedCI

A module to set ticket attributes based on a linked configuration item.

Process Management Module TicketUpdateByLinkedCI

Process Management Module TicketUpdateByLinkedCI

Main search parameters section

The following parameters can be used for restrictions:

  • Class

  • Deployment State

  • Incident State

  • Link Type

Desired behavior section

If more than one configuration items are found in the section above, the desired behavior can be defined here.

Possible values:

  • Copy attributes from the configuration item that was found first

  • Copy attributes from the configuration item that was found last

  • Ignore configuration item, do not copy anything

Mapping configuration item to ticket section

With this module the configuration item attributes to ticket attributes can be mapped. The key is the attribute of the configuration item. The value is the attribute of the ticket.

Examples:

Key

Value

HardDisk::Capacity

DynamicField_HDCapacity

Name

Title

See also

See the TicketUpdateByLinkedCI and the ConfigItemSearch() API reference.

API Reference

These API references are not available online, but they are included in this manual.

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'
         },
     },
 };
Scroll to Top