Firing a custom event

Unlike system events, with custom events, you need to tell Jira when it can fire a custom event.

Custom events are mostly fired by workflow transitions. Recall from Chapter 7Workflow and Business Process, that you can add post functions to workflow transitions. Almost all of Jira's transitions will have a post function that fires an appropriate event. It is important to understand that just because an event is fired does not mean that there needs to be something to listen to it.

If you skipped Chapter 7Workflow and Business Process, or still do not have a good understanding of workflows, now would be a good time to go back and revisit that chapter.

Perform the following steps to fire a custom event from a workflow post function:

  1. Browse to the View Workflows page.
  2. Click on the Edit link for the workflow that will be used to fire the event.
  3. Click on the transition that will fire the event when executed.
  4. Click on the Post Functions tab.
  1. Click on the Edit link for the post function that reads Fire a <event name> event that can be processed by the listeners:
  1. Select the custom event from the drop-down list.
  2. Click on the Update button to apply any changes to the post function.
  3. Publish the workflow.

Now, whenever the workflow transition is executed, the post function will run and fire the selected event. Each transition can fire only one event, so you cannot have both Issue Created and Issue Updated events being fired from the same transition.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset