Kernel::GenericInterface::Operation::Service::ServiceUpdate

NAME

Kernel::GenericInterface::Operation::Service::ServiceUpdate – GenericInterface Service ServiceUpdate Operation backend

PUBLIC INTERFACE

has OperationSubType

Attribute that holds the operation sub type.

has Operation

Attribute that holds the operation name.

has ServiceList

Attribute that holds all valid and invalid system services.

has ValidList

Attribute that holds the list of validities

has TypeList

Attribute that holds the types list coming from General Catalog class ITSM::Service::Type

has CriticalityList

Attribute that holds the list of criticality values coming from Dynamic Field ITSMCriticality.

has CurrentService

Attribute that holds current stored data of the web service before the update.

Run()

perform ServiceUpdate Operation. This will return the ServiceID of the updated service.

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

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

            ServiceID => 123,                       # ServiceID or Name is required
            Name      => 'some::full::name',        # Used to identify se service (instead of ServiceID)
                                                    # Provide only ServiceID OR Name

            Service => {                                    # optional
                NameShort    => 'othername',                # optional, used to rename the service

                ParentID     => 123,                        # optional
                Parent       => 'some::full::parentname',   # optional

                ValidID      => 123,                        # optional
                Valid        => 'valid'                     # optional valid | invalid | invalid-temporary

                Comment      => 'some comment'              # optional

                TypeID       => 123,                        # optional
                Type         => 'some type',                # optional

                Criticality => 'some criticality'           # optional
            }

            DynamicField => [                               # optional
                {
                    Name   => 'some name',
                    Value  => $Value,                       # value type depends on the dynamic field
                },
                # ...
            ],
            # or
            # DynamicField => {
            #    Name   => 'some name',
            #    Value  => $Value,
            #},

            Preference => [                               # optional
                {
                    Name   => 'some name',
                    Value  => $Value,                       # value type depends on the dynamic field
                },
                # ...
            ],
            # or
            # Preference => {
            #    Name   => 'some name',
            #    Value  => $Value,
            #},
        },
    );

    $Result = {
        Success         => 1,                       # 0 or 1
        ErrorMessage    => '',                      # in case of error
        Data            => {                        # result data payload after Operation
            ServiceID => 123,
            Service {
                ServiceID         => 123,
                Name              => 'some::full::name',
                NameShort         => 'some name',
                ParentID          => 123,
                ValidID           => 1,
                Comment           => 'some comment',
                TypeID            => 123,
                Type              => 'some type',
                Criticality       => 'some criticality',
                CurInciStateID    => 123,
                CurInciState      => 'Operational',       # e.g. Operational | Warning | Incident
                CurInciStateType  => 'operational',       # w.g. operational | warning | incident

                # List of dynamic fields
                DynamicField => [
                    {
                        Name  => 'some name',
                        Value => 'some value',
                    },
                    # ...
                ],

                # List of preferences
                Preference => [
                    {
                        Name  => 'some name',
                        Value => 'some value',
                    },
                    # ...
                ],
            },
            Error => {                              # should not return errors
                ErrorCode    => 'ErrorCode',
                ErrorMessage => 'Error Description',
            },
        },
    };
Scroll to Top