statemachine
Invipay workflow
for field
State
{
on
send to backlog
[
always
]
do
{
<define statements>
}
transit to
Accepted
on
start hotfix
[
always
]
do
{
if
(
subtask of
.
isNotEmpty
)
{
//
feature subtasks are created directly in open state on feature dashboard and this workflow is executed
//
we just don't want to mark them as hotfixes
//
otherwise from submitted we can only open hotfixes
project
.
leader
.
notify
(
"
[ASSIGNEE]
"
+
getId
(
)
+
"
:
"
+
summary
,
getUrl
(
)
)
;
on
can't reproduce
[
always
]
do
{
<define statements>
}
transit to
Can't Reproduce
on
won't fix
[
always
]
do
{
<define statements>
}
transit to
Won't fix
on
duplicate
[
always
]
do
{
<define statements>
}
transit to
Duplicate
on
start hotfix
[
always
]
do
{
project
.
leader
.
notify
(
"
[ASSIGNEE]
"
+
getId
(
)
+
"
:
"
+
summary
,
getUrl
(
)
)
;
on
send to development
[
always
]
do
{
project
.
leader
.
notify
(
"
[ASSIGNEE]
"
+
getId
(
)
+
"
:
"
+
summary
,
getUrl
(
)
)
;
on
can't reproduce
[
always
]
do
{
<define statements>
}
transit to
Can't Reproduce
on
won't fix
[
always
]
do
{
<define statements>
}
transit to
Won't fix
on
duplicate
[
always
]
do
{
<define statements>
}
transit to
Duplicate
on
reopen
[
always
]
do
{
<define statements>
}
transit to
Submitted
on
reopen
[
always
]
do
{
<define statements>
}
transit to
Submitted
on
reopen
[
always
]
do
{
<define statements>
}
transit to
Submitted
assert
loggedInUser
==
Assignee
:
"
Only assignee can start work on this ticket.
"
;
message
(
"
Don't forget to create ticket branch from master for this ticket.
"
)
;
}
else if
(
Branch
==
{
Ticket
}
)
{
message
(
"
Don't forget to create ticket branch from integration for this ticket.
"
)
;
on
can't reproduce
[
always
]
do
{
<define statements>
}
transit to
Can't Reproduce
on
won't fix
[
always
]
do
{
<define statements>
}
transit to
Won't fix
on
duplicate
[
always
]
do
{
<define statements>
}
transit to
Duplicate
on
send to code revision
[
always
]
do
{
assert
loggedInUser
==
Assignee
:
"
Only assignee can finish work on this ticket.
"
;
assert
Tester
==
null
:
"
This ticket is already in testing stage and shouldn't be sent to code revision anymore. You should send it for test.
"
;
assert
Branch
==
{
Ticket
}
:
"
Only tickets in ticket branch can be send to code revision.
"
;
project
.
leader
.
notify
(
"
[CODE REVIEWER]
"
+
getId
(
)
+
"
:
"
+
summary
,
getUrl
(
)
)
;
//
workflow within the feature is free
subtask of
.
first
.
Assignee
.
notify
(
"
[CODE REVIEWER]
"
+
getId
(
)
+
"
:
"
+
summary
,
getUrl
(
)
)
;
assert
loggedInUser
==
Assignee
:
"
Only assignee can finish work on this ticket.
"
;
assert
Branch
!=
{
Ticket
}
:
"
Tickets in ticket branch are not prepared for testing yet. Please merge this ticket to integration branch
"
+
"
and change Branch field of this ticket.
"
;
project
.
leader
.
notify
(
"
[TESTER]
"
+
getId
(
)
+
"
:
"
+
summary
,
getUrl
(
)
)
;
message
(
"
Done hotfixes are moved instantly to master to be released. Please merge ticket branch to master immediately!
"
)
;
//
workflow within the feature is free
on
can't reproduce
[
always
]
do
{
<define statements>
}
transit to
Can't Reproduce
on
won't fix
[
always
]
do
{
<define statements>
}
transit to
Won't fix
on
duplicate
[
always
]
do
{
<define statements>
}
transit to
Duplicate
assert
loggedInUser
==
Code reviewer
:
"
Only code reviewer can reopen this ticket.
"
;
assert
Branch
==
{
Ticket
}
:
"
Only tickets in ticket branch can be sent back from code revision.
"
;
//
workflow within the feature is free
on
send to integration
[
always
]
do
{
assert
loggedInUser
==
Code reviewer
:
"
Only code reviewer can finish this ticket.
"
;
assert
Branch
==
{
Ticket
}
:
"
Only tickets in ticket branch can be sent to integration.
"
;
addComment
(
"
Code revision passed, please merge this ticket to integration branch and change branch to Integration.
"
)
;
addComment
(
"
Code revision passed, please merge this ticket to master branch and change branch to Master.
"
)
;
//
workflow within the feature is free
assert
loggedInUser
==
Tester
:
"
Only tester can reopen this ticket.
"
;
assert
Branch
!=
{
Ticket
}
:
"
Fixed tickets in ticket branch should be merged to integration, not reopened.
"
;
//
workflow within the feature is free
on
tests passed
[
always
]
do
{
assert
loggedInUser
==
Tester
:
"
Only tester can mark this ticket verified.
"
;
assert
Branch
!=
{
Ticket
}
:
"
Tickets in ticket branch are not sent for tests yet, so they cannot be marked as verified.
"
;
//
workflow within the feature is free