4. Workflow

4.1. Dobre praktyki

  • Directed graph

  • Complete graph

  • Few vertices

  • Lots of Edges

  • Try simple and add statuses

  • Keep transitions from all statues

  • Simplified Workflow

../_images/jira-workflow-progress,test,review.png
../_images/jira-workflow-simplified.png

4.2. Workflow Triggers

  • Bitbucket:

    • Pull request created

    • Pull request merged

    • Pull request declined

    • Pull request reopened

    • Branch created

    • Commit created

Bamboo:

  • Deployment successful

  • Deployment failed

Crucible:

  • Review started

  • Review abandoned

  • Review submitted for approval

  • Review closed

  • Review rejected

  • Review summarized

../_images/jira-workflow-simplified,triggers.png
../_images/jira-triggers-1.png
../_images/jira-triggers-2.png
../_images/jira-triggers-3.png

4.3. Condition

Condition

Name

Description

Always False Condition

This condition always fails

Block transition until approval

Condition to block issue transition if there is a pending approval

Compare Number Custom Field

Condition to allow transition if a comparison of specified Number Custom Field to a specified value is true

Hide From User Condition

Condition to hide a transition from the user. The transition can only be triggered from a workflow function or from REST

Only Assignee Condition

Condition to allow only the assignee to execute a transition

Only Bamboo Notifications Workflow Condition

Only makes this transition available to the Bamboo build notifications

Only Reporter Condition

Condition to allow only the reporter to execute a transition

Permission Condition

Condition to allow only users with a certain permission to execute a transition

Previous Status Condition

Condition to check if the issue has transitioned through a specified status or no

Separation of Duties condition

Condition preventing a user to perform the transition, if the user has already performed a transition on the issue

Sub-Task Blocking Condition

Condition to block parent issue transition depending on sub-task status

User Is In Any Group

Condition to allow only users in a given group to execute a transition

User Is In Any Project Role

Condition to allow only users in a given project role to execute a transition

User Is In

Custom field Allows only users in a given custom field to execute the transition

User Is In Group

Condition to allow only users in a given group to execute a transition

User Is In Group Custom Field

Condition to allow only users in a custom field-specified group to execute a transition

User Is In Project Role

Condition to allow only users in a given project role to execute a transition

Value Field

Allows to execute a transition if the given value of a field is equal to a constant value, or simply set

4.4. Validators

Validators

Name

Description

Date Compare Validator

Compare two dates during a workflow transition

Date Window Validator

Compares two date fields, by adding a time span in days to one of them

Field Required Validator

Field must not be empty during the transition

Field has been modified Validator

Field value must be changed during the transition

Field has single value Validator

Multi-select Field has not more than one value during transition

Parent Status Validator

Validates that the parent issue is in required state

Permission Validator

Validates that the user has a permission

Previous State Validator

Validates that the issue has previously transitioned through a specific state

Regular Expression Check

Validate field contents against a regular expression during a workflow transition

User Permission Validator

Validates that the user has a permission, where the OSWorkflow variable holding the username is configurable. Obsolete

4.5. Post Functions

Post Functions

Name

Description

Assign to Current User

Assigns the issue to the current user if the current user has the ‘Assignable User’ permission

Assign to Lead Developer

Assigns the issue to the project/component lead developer

Assign to Reporter

Assigns the issue to the reporter

Clear Field Value

Clear value of a given field

Copy Value From Other Field

Copies the value of one field to another, either within the same issue or from parent to sub-task

Create Crucible Review Workflow Function

Creates a Crucible review for all unreviewed code for this issue

Notify HipChat

Send a notification to one or more HipChat rooms

Set issue security level based on user’s project role

Set the issue’s Security Level to the specified level if the current user is in a specified Project Role

Trigger a Webhook

If this post-function is executed, Jira will post the issue content in JSON format to the URL specified

Update Issue Custom Field

Updates an issue custom field to a given value

Update Issue Field

Updates a simple issue field to a given value

4.6. Workflow Schemes

4.7. Use Cases

_img/jira-workflow-aprooval.png

aprooval

../_images/jira-workflow-core.jpeg

core

../_images/jira-workflow-default.png

default

../_images/jira-workflow-dev-1.png

dev

../_images/jira-workflow-dev-2.png

dev

../_images/jira-workflow-epics.png

Epics

../_images/jira-workflow-feedback.png

feedback

../_images/jira-workflow-processmgmt.png

processmgmt

../_images/jira-workflow-procurement.png

procurement

../_images/jira-workflow-progress,test,review.png

progress

../_images/jira-workflow-projectmgmt.png

projectmgmt

../_images/jira-workflow-publishing.png

publishing

../_images/jira-workflow-qa,review.png

qa

../_images/jira-workflow-qa,stage,deploy,problem.jpg

qa

../_images/jira-workflow-qa,stage,deploy.png

qa

../_images/jira-workflow-qa.png

qa

../_images/jira-workflow-recruitment.png

recruitment

../_images/jira-workflow-risk.jpg

risk

../_images/jira-workflow-select.png

select

../_images/jira-workflow-simplified.png

simplified

../_images/jira-workflow-simplified,dev.png

simplified dev

../_images/jira-workflow-support.png

support

../_images/jira-workflow-taskmgmt.png

taskmgmt

4.8. Assignments

4.8.1. Workflow Configure

  1. Skrót klawiszowy gg -> workflows

  2. Wybieramy Twój workflow i link Edit (po prawej stronie)

  3. Przycisk Diagram (po lewej stronie)

  4. Przycisk dwie strzałki do góry ^ (otworzy edytor workflow w trybie pełnoekranowym)

  5. Przycisk Add Status (u góry po lewej)

    • Name: In Test

    • nie zaznaczamy Allow all statuses to transition to this one

    • Kliknij przycisk Add

    • Status category: In Progress

    • Kliknij przycisk Create

  6. Chwyć jedną kropkę na brzegu statusu In Progress i połącz z jedną kropką na brzegu statusu In Test

  7. Tworzysz tzw. tranzycję:

    • Name: To Test

    • Kliknij przycisk Add

  8. Ze statusu In Test dodaj tranzycję do In Progress o nazwie To In Progress

  9. Ze statusu In Test dodaj tranzycję do Done o nazwie To Done

  10. Usuń tranzycję All do statusu Done (w menu po prawej), tak aby móc przenosić do Done tylko zadania przetestowane

  11. Kliknij na tranzycję To Test (z In Progress do In Test) i klikamy na Conditions -> Add Condition -> Only Assignee Condition -> Add

  12. Kliknij przycisk Publish (przycisk po prawej u góry) -> Save a backup copy?: No -> Publish

4.8.2. Workflow Edit

  1. Skrót klawiszowy gg -> workflows

  2. Wybieramy Twój workflow i link Edit (po prawej stronie)

  3. Dodaj status In Review -> Category: In Progress -> Create

  4. Edytuj tranzycję z In Test do Done, zmień by prowadziła z In Test do In Review oraz zmień nazwę na To Review

  5. Dodaj tranzycję z In Review do Done o nazwie To Done

  6. Edytuj tranzycję To Review i edytuj Post Function (menu z prawej strony) -> Add post function -> Assign to Reporter -> Add

  7. Kliknij przycisk Publish (przycisk po prawej u góry) -> Save a backup copy?: No -> Publish

4.8.3. Workflow Board Status Mapping

  1. Z menu u góry wybierz Boards -> Twój Board -> Active Sprint

  2. Z menu Board (prawy górny róg) -> Configure -> Zakładka Columns

  3. Zwróć uwagę na Unmapped Statuses w kolumnie po prawej

  4. Dodaj kolumnę In Test (przycisk Add Column) i przenieś do niej status In Test

  5. Dodaj kolumnę In Review (przycisk Add Column) i przenieś do niej status In Review

  6. Wróć na Board i zobacz nowe kolumny

  7. Przenieś zadanie Four do In Test

  8. Zwróć uwagę, że nie można było go przenieść do In Review

  9. Zwróć uwagę, że kolumna Done była tylko Rejected (przeniesienie do niej, odrzucało by zadanie)

  10. Przenieś zadanie Four do In Review

  11. Teraz na powrót kolumna Done ma dwa statusy: Done i Rejected

  12. Tylko z In Review można przenieść do Done