Event linking a ticket to a CI

Hello, I would like some directions on how to develop a event action when a ticket is linked to a CI could someone give me some tips, where to start or any help? Thanks

Hi Wagner, On Wed, 30 Nov 2011 20:20:33 -0200, Wagner wrote:
I would like some directions on how to develop a event action when a ticket is linked to a CI
could someone give me some tips, where to start or any help?
Hi, you should register an event module that listens on the LinkAdd event. An example is this registration in the ITSMConfigItem module (although it listens to much more events): <ConfigItem Name="ITSMConfigItem::EventModulePost###100-History" Required="0" Valid="1"> <Description Translatable="1">Config item event module that enables logging to history in the agent interface.</Description> <Group>ITSM Configuration Management</Group> <SubGroup>Core::ITSMConfigItem</SubGroup> <Setting> <Hash> <Item Key="Module">Kernel::System::ITSMConfigItem::Event::DoHistory</Item> <Item Key="Event">(ConfigItemCreate|VersionCreate|DeploymentStateUpdate|IncidentStateUpdate|ConfigItemDelete|LinkAdd|LinkDelete|DefinitionUpdate|NameUpdate|ValueUpdate|DefinitionCreate|VersionDelete)</Item> <Item Key="Transaction">0</Item> </Hash> </Setting> </ConfigItem> Now on LinkAdd the Kernel::System::ITSMConfigItem::Event::DoHistory is executed, you can create your own module and execute business logic that way. -- Mike

Hi Michiel,
Thanks a lot, I'll try to create it
2011/12/1 Michiel Beijen
Hi Wagner,
On Wed, 30 Nov 2011 20:20:33 -0200, Wagner wrote:
I would like some directions on how to develop a event action when a
ticket is linked to a CI
could someone give me some tips, where to start or any help?
Hi, you should register an event module that listens on the LinkAdd event. An example is this registration in the ITSMConfigItem module (although it listens to much more events):
<ConfigItem Name="ITSMConfigItem::**EventModulePost###100-History" Required="0" Valid="1"> <Description Translatable="1">Config item event module that enables logging to history in the agent interface.</Description> <Group>ITSM Configuration Management</Group> <SubGroup>Core::**ITSMConfigItem</SubGroup> <Setting> <Hash> <Item Key="Module">Kernel::System::** ITSMConfigItem::Event::**DoHistory</Item> <Item Key="Event">(ConfigItemCreate|**VersionCreate|** DeploymentStateUpdate|**IncidentStateUpdate|**ConfigItemDelete|LinkAdd|** LinkDelete|DefinitionUpdate|**NameUpdate|ValueUpdate|**DefinitionCreate|** VersionDelete)</Item> <Item Key="Transaction">0</Item> </Hash> </Setting> </ConfigItem>
Now on LinkAdd the Kernel::System::**ITSMConfigItem::Event::**DoHistory is executed, you can create your own module and execute business logic that way.
-- Mike
______________________________**_________________ OTRS mailing list: dev - Webpage: http://otrs.org/ Archive: http://lists.otrs.org/**pipermail/devhttp://lists.otrs.org/pipermail/dev To unsubscribe: http://lists.otrs.org/cgi-bin/**listinfo/devhttp://lists.otrs.org/cgi-bin/listinfo/dev

Hi again,
I think the event is wrong, cause the LinkAdd event is being called when I
link a ticket to another ticket, but when I link a ticket to a CI it's not
being called
is there a way to find out which event should I use?
Thanks
2011/12/1 Wagner
Hi Michiel,
Thanks a lot, I'll try to create it
2011/12/1 Michiel Beijen
Hi Wagner,
On Wed, 30 Nov 2011 20:20:33 -0200, Wagner wrote:
I would like some directions on how to develop a event action when a
ticket is linked to a CI
could someone give me some tips, where to start or any help?
Hi, you should register an event module that listens on the LinkAdd event. An example is this registration in the ITSMConfigItem module (although it listens to much more events):
<ConfigItem Name="ITSMConfigItem::**EventModulePost###100-History" Required="0" Valid="1"> <Description Translatable="1">Config item event module that enables logging to history in the agent interface.</Description> <Group>ITSM Configuration Management</Group> <SubGroup>Core::**ITSMConfigItem</SubGroup> <Setting> <Hash> <Item Key="Module">Kernel::System::** ITSMConfigItem::Event::**DoHistory</Item> <Item Key="Event">(ConfigItemCreate|**VersionCreate|** DeploymentStateUpdate|**IncidentStateUpdate|**ConfigItemDelete|LinkAdd|** LinkDelete|DefinitionUpdate|**NameUpdate|ValueUpdate|**DefinitionCreate|* *VersionDelete)</Item> <Item Key="Transaction">0</Item> </Hash> </Setting> </ConfigItem>
Now on LinkAdd the Kernel::System::**ITSMConfigItem::Event::**DoHistory is executed, you can create your own module and execute business logic that way.
-- Mike
______________________________**_________________ OTRS mailing list: dev - Webpage: http://otrs.org/ Archive: http://lists.otrs.org/**pipermail/devhttp://lists.otrs.org/pipermail/dev To unsubscribe: http://lists.otrs.org/cgi-bin/**listinfo/devhttp://lists.otrs.org/cgi-bin/listinfo/dev

Hi Wagner, On Thu, 1 Dec 2011 14:11:44 -0200, Wagner wrote:
I think the event is wrong, cause the LinkAdd event is being called when I link a ticket to another ticket, but when I link a ticket to a CI it's not being called
is there a way to find out which event should I use?
I tested by logging out of Kernel::System::EventHandler every time it is called, and I found the LinkAdd event is executed when you link a ticket to a CI. It really is the correct event. [Fri Dec 2 14:31:07 2011][Notice][Kernel::System::EventHandler::EventHandler] Running for LinkAdd -- Mike

Yes, I changed some things here, and got it right
thanks for your reply
I'm just trying to change the incidate state from the CI but I'm not going
anywhere =/
2011/12/2 Michiel Beijen
Hi Wagner,
On Thu, 1 Dec 2011 14:11:44 -0200, Wagner wrote:
I think the event is wrong, cause the LinkAdd event is being called when
I link a ticket to another ticket, but when I link a ticket to a CI it's not being called
is there a way to find out which event should I use?
I tested by logging out of Kernel::System::EventHandler every time it is called, and I found the LinkAdd event is executed when you link a ticket to a CI. It really is the correct event.
[Fri Dec 2 14:31:07 2011][Notice][Kernel::System::**EventHandler::EventHandler] Running for LinkAdd
-- Mike ______________________________**_________________ OTRS mailing list: dev - Webpage: http://otrs.org/ Archive: http://lists.otrs.org/**pipermail/devhttp://lists.otrs.org/pipermail/dev To unsubscribe: http://lists.otrs.org/cgi-bin/**listinfo/devhttp://lists.otrs.org/cgi-bin/listinfo/dev

Hello,
I need to be sure that the source object is a Ticket and the target object
is a ITSMConfigItem
how can I do that using the LinkObject?
thanks
2011/12/2 Wagner
Yes, I changed some things here, and got it right
thanks for your reply
I'm just trying to change the incidate state from the CI but I'm not going anywhere =/
2011/12/2 Michiel Beijen
Hi Wagner,
On Thu, 1 Dec 2011 14:11:44 -0200, Wagner wrote:
I think the event is wrong, cause the LinkAdd event is being called when
I link a ticket to another ticket, but when I link a ticket to a CI it's not being called
is there a way to find out which event should I use?
I tested by logging out of Kernel::System::EventHandler every time it is called, and I found the LinkAdd event is executed when you link a ticket to a CI. It really is the correct event.
[Fri Dec 2 14:31:07 2011][Notice][Kernel::System::**EventHandler::EventHandler] Running for LinkAdd
-- Mike ______________________________**_________________ OTRS mailing list: dev - Webpage: http://otrs.org/ Archive: http://lists.otrs.org/**pipermail/devhttp://lists.otrs.org/pipermail/dev To unsubscribe: http://lists.otrs.org/cgi-bin/**listinfo/devhttp://lists.otrs.org/cgi-bin/listinfo/dev

Any ideas on how to get this info from the LinkObject?
Thanks
2011/12/5 Wagner
Hello,
I need to be sure that the source object is a Ticket and the target object is a ITSMConfigItem
how can I do that using the LinkObject?
thanks
2011/12/2 Wagner
Yes, I changed some things here, and got it right
thanks for your reply
I'm just trying to change the incidate state from the CI but I'm not going anywhere =/
2011/12/2 Michiel Beijen
Hi Wagner,
On Thu, 1 Dec 2011 14:11:44 -0200, Wagner wrote:
I think the event is wrong, cause the LinkAdd event is being called when
I link a ticket to another ticket, but when I link a ticket to a CI it's not being called
is there a way to find out which event should I use?
I tested by logging out of Kernel::System::EventHandler every time it is called, and I found the LinkAdd event is executed when you link a ticket to a CI. It really is the correct event.
[Fri Dec 2 14:31:07 2011][Notice][Kernel::System::**EventHandler::EventHandler] Running for LinkAdd
-- Mike ______________________________**_________________ OTRS mailing list: dev - Webpage: http://otrs.org/ Archive: http://lists.otrs.org/**pipermail/devhttp://lists.otrs.org/pipermail/dev To unsubscribe: http://lists.otrs.org/cgi-bin/**listinfo/devhttp://lists.otrs.org/cgi-bin/listinfo/dev
participants (2)
-
Michiel Beijen
-
Wagner