It's all about the answers!

Ask a question

RTC API: How to create an event listener using a web API?


Isabel Torres (63938) | asked Feb 22 '16, 7:02 p.m.
JAZZ DEVELOPER
edited Feb 22 '16, 7:04 p.m.
We are trying to create an event listener on work items save button (after a change is done). What we need to do is, 1) check the list of subscribers of the work item or the "filed Against" value, 2) detect the change just saved (User, date, change details), 3) get the URL of the work item, 4) invoke a web API to notify about the change just saved. This needs to be done in our server (6.0.1) and only on select Project Areas. Can you guide us with some reference or help, please?



Comments
1
sam detweiler commented Feb 22 '16, 8:33 p.m.

that is an advisor (that always says ok).

you have old state, new state, and can call out to other services.

Ralph has advisors of all kinds on his blog
https://rsjazz.wordpress.com/


Accepted answer


permanent link
Ralph Schoon (63.1k33646) | answered Feb 23 '16, 2:31 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
You can also follow

Extension Points and Operation ID’s to try to create an event handler, using the extension point below.

<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.4"?>
<plugin>
   <extension
         point="com.ibm.team.process.service.eventHandlers">
      <eventHandler
            class="ibm.rtc.handler.notification.ChangeEventHandler"
            id="ibm.rtc.handler.notification.eventHandler"
            name="Category based email notification"
            eventCategory="com.ibm.team.workitem.event.stateChanged"
            schema="schema/handlerNotification.xsd">
            <extensionService
                  componentId="ibm.rtc.handler.notification.eventHandler"
                  implementationClass="ibm.rtc.handler.notification.ChangeEventHandler">
                  <prerequisites>
                          <requiredService interface="com.ibm.team.repository.service.IMailerService"/>
                          <requiredService interface="com.ibm.team.repository.service.IRepositoryItemService"/>
                          <requiredService interface="com.ibm.team.repository.service.IServerDescriptionService"/>
                          <requiredService interface="com.ibm.team.workitem.common.IWorkItemCommon"/>
                  </prerequisites>
            </extensionService>
      </eventHandler>     
   </extension>
</plugin>


Or you can try to use an Asynchronous Task
Other than follow up actions or participants, that you could also use, these run in an administrative context and not in the context of the user that performs the operation.
Isabel Torres selected this answer as the correct answer

Your answer


Register or to post your answer.


Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.