Use Case

This workflow was originally taken from a submitted request (JT-7821).

The user who submitted this issue wanted to make sure that the resolution of an issue could be approved by the user who reported the issue.

Here's how it works:

The reporter creates an issue.

The issue is fixed, and status is set to fixed (and is built and deployed by TeamCity).

When the ticket is deployed (in a test/stage or production environment) the status is set to Pending verification in Test/production
(either manually by the developer or automatically based on some status information from TeamCity).

Notification is sent to the reporter.

The reporter tests the issue in the suitable environment and determines that

it is fixed and approves the issue and it is closed (or has a state of approved or something like it)

it is still not working, and is returned to the developer as "not approved" (or project lead or something).

Rules

This workflow includes two rules. The first rule is used to send notifications and the second manages the lifecycle of an issue.

Send specific notification to reporter to approve fix

The first rule notifies the user who reported the issue and sets the reporter as the assignee.

When an issue is updated, this rule checks whether the state was changed to Pending verification. If true, then:

State lifecycle with verification by reporter

The next rule defines the lifecycle for issues to support this use case.

This rule defines the following transitions for issue states:

An issue starts with the state Submitted.

From the initial state, an issue can only transition to the following state:

On event (action) Open, the state is set to Open.

From the Open state, an issue can only transition to the following state:

On event (action) Fix, the state is set to Fixed.

When the state is set to Fixed, the user is forced to set the Fixed in build field.

From the Fixed state, an issue can only transition to the following state:

On event (action) Send for verification, the state is set to Pending for verification.

When the state is set to Pending for Verification, the reporter is set as the Assignee.
The reporter is notified and asked to approve the fix.

From the Pending for Verification state, an issue can only transition to the following states:

On event (action) Approve, the state is set to Verified.

On event (action) Re-open, the state is set to Open.

From the Open state, the issue can only transition to Fixed.

From the Verified state, no further state transitions are allowed.

statemachineStatelifecyclewithverificationbyreporterforfieldState{initialstateSubmitted{onOpen[always]do{<definestatements>}transittoOpen}stateOpen{onFix[always]do{<definestatements>}transittoFixed}stateFixed{enter{Fixedinbuild.required("Please set 'Fixed in build' value.");}onSendforverification[always]do{<definestatements>}transittoPendingverification}statePendingverification{enter{Assignee=reporter;reporter.notify(l10n(Pleaseapprovefixfortheissue{getId()},l10n(Youhavereportedissue{getId()}.Pleaseverifytheappliedfixfortheissueandsettheappropriatestate.));}onApprove[always]do{<definestatements>}transittoVerifiedonRe-open[always]do{<definestatements>}transittoOpen}stateVerified{onRe-open[always]do{<definestatements>}transittoOpen}}