An escalation workflow integrated with Atlassian JIRA using SonataFlow.
Email service is using MailTrap Send email API API
- Access to a Jira server (URL, user and API token)
- Access to an OpenShift cluster with
admin
Role - An account to MailTrap with a testing Inbox and an API token
Note:
The value of the .jiraIssue.fields.status.statusCategory.key
field is the one to be used to identify when the done
status is reached, all the other
similar fields are subject to translation to the configured language and cannot be used for a consistent check.
Application properties can be initialized from environment variables before running the application:
Environment variable | Description | Mandatory | Default value |
---|---|---|---|
JIRA_URL |
The Jira server URL | ✅ | |
JIRA_USERNAME |
The Jira server username | ✅ | |
JIRA_API_TOKEN |
The Jira API Token | ✅ | |
JIRA_PROJECT |
The key of the Jira project where the escalation issue is created | ❌ | TEST |
JIRA_ISSUE_TYPE |
The ID of the Jira issue type to be created | ✅ | |
MAILTRAP_URL |
The MailTrail API Token | ❌ | https://sandbox.api.mailtrap.io |
MAILTRAP_API_TOKEN |
The MailTrail API Token | ✅ | |
MAILTRAP_INBOX_ID |
The ID of the MailTrap inbox | ✅ | |
MAILTRAP_SENDER_EMAIL |
The email address of the mail sender | ❌ | [email protected] |
OCP_API_SERVER_URL |
The OpensShift API Server URL | ✅ | |
OCP_API_SERVER_TOKEN |
The OpensShift API Server Token | ✅ | |
ESCALATION_TIMEOUT_SECONDS |
The number of seconds to wait before triggering the escalation request, after the issue has been created | ❌ | 60 |
POLLING_PERIODICITY (1) |
The polling periodicity of the issue state checker, according to ISO 8601 duration format | ❌ | PT6S |
(1) This is still hardcoded as PT5S
while waiting for a fix to KOGITO-9811
mvn clean quarkus:dev
Example of POST to trigger the flow (see input schema in ocp-onboarding-schema.json):
curl -XPOST -H "Content-Type: application/json" http://localhost:8080/ticket-escalation -d '{"namespace": "_YOUR_NAMESPACE_", "manager": "_YOUR_EMAIL_"}'
Tips:
- Visit Workflow Instances
- Visit (Data Index Query Service)[http://localhost:8080/q/graphql-ui/]