HAPI Examples
You may have read how HAPI works but are unsure how to use it effectively in your Jira instance. Below are multiple use cases/examples that incorporate HAPI in the scripts, ready for you to explore and customize to your Jira instance:
- Automatically add users to linked issues as watchers
- Calculate the impact of an issue based on the number of linked support cases
For the examples on this page, you will notice a reference to Great Adventure. Great Adventure is the fictitious company we use to help provide use cases and examples of concepts covered.
Automatically add users to linked issues as watchers
Scenario
When a support request is raised, other issues are sometimes linked to the support request issue because they cause the support request. Great Adventure wants the reporter of the initial support request, and request participants, to be automatically added as watchers to the linked issues that cause the raised issue.
With this automation, Great Adventure can ensure people are informed of linked issues and subsequently progress.
Solution
Create a custom listener and use HAPI.
Why is HAPI useful?
With HAPI, we've made it easy for you to Work with Issue Links, Users, and Watchers. This means the script for the following use case has fewer imports, is much shorter, and is easier to adapt to your own instance if desired.
Steps
Calculate the impact of an issue based on the number of linked support cases
Scenario
Great Adventure wants to calculate the impact of an issue based on the number of customer support cases that have been linked to it.
With this automation, Great Adventure can monitor the impact of certain issues and use JQL search to easily identify high impact issues.
Solution
Create a custom script field and use HAPI to count the number of causes links an issue has.
Why is HAPI useful?
With HAPI, we've made it easy for you to Work with Issue Links. This means the script for the following use case is much simpler and easy to adapt to your own instance if desired.
Steps
Automatically add reviewers based on the issue request type
Scenario
Great adventure wants reviewers to be set automatically depending on the issue request type. For example, purchases over 100 dollars need to be cleared by the accounts department, and any travel requests need to be cleared by your manager.
With this automation, Great Adventure can stay aligned with their internal auditing and governance rules.
Solution
Create a custom workflow function and use HAPI.
Why is HAPI useful?
With HAPI, we've made it easy for you to Update Issues from a workflow function. This means the script for the following use case is much simpler and easy to adapt to your own instance if desired.