Fires an Event when Condition is True
The Fires an event when condition is true post function enables you to trigger a specific Jira event based on a custom condition. Once fired, the event can be picked up by a notification scheme, determining who gets alerted.
Jira events, such as the Issue created or Issue updated event, are predefined occurrences in an issue's lifecycle. This post function allows you to fire these events even if that event wouldn't normally be triggered at that point in the workflow. This post function only fires the event when your specified condition is met, providing precise control over when notifications are sent.
By combining custom conditions with Jira's existing event types and notification infrastructure, you can create highly targeted alerts. This post function bridges the gap between Jira's standard event system and your workflow's unique requirements, allowing for more flexible and responsive issue management and communication.
Example
As an example, we have a software development project in Jira, and we want to automatically notify the QA team when a high-priority bug is resolved. We would do the following:
- Create a custom event in Jira called High Priority Bug Resolved.
- Create a notification scheme in Jira that listens for this custom event and sends an email to the QA team.
- Locate the transition where we want to add this post function (for example from In Progress to Resolved).
- Add this post function to the chosen transition.
- Use the following condition in the post function:
issue.priority.name == "High" && issue.issueType.name == "Bug" - Specify the event to be fired when the condition is true. In this case, we would use the custom event High Priority Bug Resolved.
The above is a summary of the steps you would take to create a Jira event, a notification scheme, and this post function. See below for more detailed steps on how to set up this post function.
Use this post function:
You can now test to see if this post function works.