Skip to content

Commit c4a2468

Browse files
committed
Handle resolved condition in the frontend
1 parent 76dde99 commit c4a2468

File tree

5 files changed

+11
-0
lines changed

5 files changed

+11
-0
lines changed

static/app/types/workflowEngine/dataConditions.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ export enum DataConditionType {
3131
NEW_HIGH_PRIORITY_ISSUE = 'new_high_priority_issue',
3232
REGRESSION_EVENT = 'regression_event',
3333
REAPPEARED_EVENT = 'reappeared_event',
34+
ISSUE_RESOLVED_TRIGGER = 'issue_resolved_trigger',
3435
TAGGED_EVENT = 'tagged_event',
3536
ISSUE_PRIORITY_EQUALS = 'issue_priority_equals',
3637
ISSUE_PRIORITY_GREATER_OR_EQUAL = 'issue_priority_greater_or_equal',

static/app/views/automations/components/automationBuilderContext.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,7 @@ const initialAutomationBuilderState: AutomationBuilderState = {
191191
logicType: DataConditionGroupLogicType.ANY_SHORT_CIRCUIT,
192192
conditions: [
193193
createWhenCondition(DataConditionType.FIRST_SEEN_EVENT),
194+
createWhenCondition(DataConditionType.ISSUE_RESOLVED_TRIGGER),
194195
createWhenCondition(DataConditionType.REAPPEARED_EVENT),
195196
createWhenCondition(DataConditionType.REGRESSION_EVENT),
196197
],

static/app/views/automations/components/dataConditionNodes.tsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,13 @@ export const dataConditionNodesMap = new Map<DataConditionType, DataConditionNod
123123
validate: undefined,
124124
},
125125
],
126+
[
127+
DataConditionType.ISSUE_RESOLVED_TRIGGER,
128+
{
129+
label: t('An issue is resolved'),
130+
validate: undefined,
131+
},
132+
],
126133
[
127134
DataConditionType.REGRESSION_EVENT,
128135
{

static/app/views/automations/hooks/utils.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,7 @@ export function findConflictingConditions(
154154

155155
const conflictingTriggers = new Set<DataConditionType>([
156156
DataConditionType.FIRST_SEEN_EVENT,
157+
DataConditionType.ISSUE_RESOLVED_TRIGGER,
157158
DataConditionType.REGRESSION_EVENT,
158159
DataConditionType.REAPPEARED_EVENT,
159160
]);

static/app/views/automations/new.spec.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,7 @@ describe('AutomationNewSettings', () => {
158158
logicType: 'any-short',
159159
conditions: [
160160
{type: 'first_seen_event', comparison: true, conditionResult: true},
161+
{type: 'issue_resolved_trigger', comparison: true, conditionResult: true},
161162
{type: 'reappeared_event', comparison: true, conditionResult: true},
162163
{type: 'regression_event', comparison: true, conditionResult: true},
163164
],

0 commit comments

Comments
 (0)