atlcloudjira_workflow (Resource)

Example Usage

import {
  to = atlcloudjira_workflow.SampleWorkflowResource
  id = "6a38811e-bb0d-47c3-b8b0-538a47f1dca1"
}

# __generated__ by Terraform
# Please review these resources and move them into your main configuration files.

# __generated__ by Terraform from "6a38811e-bb0d-47c3-b8b0-538a47f1dca1"
resource "atlcloudjira_workflow" "SampleWorkflowResource" {
  description = "Sample description"
  name        = "Sample Workflow Company Managed"
  scope = {
    project = null
    type    = "GLOBAL"
  }
  start_point_layout = {
    x = 82
    y = -31.599999999999994
  }
  statuses = [
    {
      deprecated = false
      layout = {
        x = 160.068359375
        y = 44.400000000000006
      }
      properties       = null
      status_reference = "10007"
    },
    {
      deprecated = false
      layout = {
        x = 204.67578125
        y = -37.599999999999994
      }
      properties = {
        SomeProp = "SomeValue"
      }
      status_reference = "10004"
    },
    {
      deprecated = false
      layout = {
        x = 259.546875
        y = 165.63827896118164
      }
      properties       = null
      status_reference = "10002"
    },
    {
      deprecated = false
      layout = {
        x = 305.546875
        y = 44.400000000000006
      }
      properties       = null
      status_reference = "3"
    },
  ]
  transitions = {
    1 = {
      actions               = null
      conditions            = null
      custom_issue_event_id = null
      description           = null
      from                  = null
      name                  = "Create"
      properties = {
        "jira.i18n.submit" = "common.forms.create"
        "jira.i18n.title"  = "common.forms.create"
      }
      to = {
        port             = 7
        status_reference = "10007"
      }
      transition_screen = null
      triggers          = null
      type              = "INITIAL"
      validators = [
        {
          parameters = {
            permissionKey = "CREATE_ISSUES"
          }
          rule_key = "system:check-permission-validator"
        },
      ]
    }
    11 = {
      actions = [
        {
          parameters = {
            issueSource    = "SAME"
            sourceFieldKey = "components"
            targetFieldKey = "description"
          }
          rule_key = "system:copy-value-from-other-field"
        },
        {
          parameters = {
            type = "to-current-user"
          }
          rule_key = "system:change-assignee"
        },
        {
          parameters = {
            type = "to-reporter"
          }
          rule_key = "system:change-assignee"
        },
        {
          parameters = {
            type = "to-lead"
          }
          rule_key = "system:change-assignee"
        },
        {
          parameters = {
            issueSecurityLevelId = "10040"
            roleId               = "10002"
          }
          rule_key = "system:set-security-level-from-role"
        },
      ]
      conditions = {
        condition_groups = [
          {
            condition_groups = null
            conditions = [
              {
                parameters = {
                  comparator     = "="
                  comparisonType = "NUMBER"
                  fieldId        = "customfield_10048"
                  fieldValue     = "[1]"
                }
                rule_key = "system:check-field-value"
              },
              {
                parameters = {
                  accountIds            = ""
                  allowUserCustomFields = ""
                  denyUserCustomFields  = ""
                  groupCustomFields     = ""
                  groupIds              = "b9ae8124-347d-4c67-ac4a-f4e8c491756d"
                  permissionKeys        = ""
                  roleIds               = ""
                }
                rule_key = "system:restrict-issue-transition"
              },
            ]
            operation  = "ALL"
            parameters = null
            rule_key   = null
          },
          {
            condition_groups = null
            conditions = [
              {
                parameters = {
                  accountIds            = "allow-assignee"
                  allowUserCustomFields = ""
                  denyUserCustomFields  = ""
                  groupCustomFields     = "customfield_10046"
                  groupIds              = ""
                  permissionKeys        = ""
                  roleIds               = ""
                }
                rule_key = "system:restrict-issue-transition"
              },
            ]
            operation  = "ANY"
            parameters = null
            rule_key   = null
          },
        ]
        conditions = [
          {
            condition_groups = null
            conditions       = null
            operation        = null
            parameters = {
              restrictMode = "usersAndAPI"
            }
            rule_key = "system:restrict-from-all-users"
          },
          {
            condition_groups = null
            conditions       = null
            operation        = null
            parameters       = null
            rule_key         = "system:block-in-progress-approval"
          },
          {
            condition_groups = null
            conditions       = null
            operation        = null
            parameters = {
              restrictMode = "users"
            }
            rule_key = "system:restrict-from-all-users"
          },
          {
            condition_groups = null
            conditions       = null
            operation        = null
            parameters = {
              accountIds            = "allow-reporter"
              allowUserCustomFields = ""
              denyUserCustomFields  = ""
              groupCustomFields     = ""
              groupIds              = ""
              permissionKeys        = ""
              roleIds               = ""
            }
            rule_key = "system:restrict-issue-transition"
          },
          {
            condition_groups = null
            conditions       = null
            operation        = null
            parameters = {
              accountIds            = ""
              allowUserCustomFields = ""
              denyUserCustomFields  = ""
              groupCustomFields     = ""
              groupIds              = ""
              permissionKeys        = "CREATE_ISSUES"
              roleIds               = ""
            }
            rule_key = "system:restrict-issue-transition"
          },
          {
            condition_groups = null
            conditions       = null
            operation        = null
            parameters = {
              ignoreLoopTransitions = "true"
              includeCurrentStatus  = "true"
              mostRecentStatusOnly  = "true"
              not                   = "false"
              previousStatusIds     = "10007"
            }
            rule_key = "system:previous-status-condition"
          },
        ]
        operation = "ALL"
      }
      custom_issue_event_id = null
      description           = "Some description"
      from = [
        {
          port             = 2
          status_reference = "10007"
        },
      ]
      name = "Start Progress"
      properties = {
        "jira.i18n.submit" = "startprogress.title"
        "jira.i18n.title"  = "startprogress.title"
      }
      to = {
        port             = 2
        status_reference = "3"
      }
      transition_screen = {
        parameters = {
          screenId = "1"
        }
        rule_key = "system:transition-screen"
      }
      triggers = [
        {
          parameters = {
            enabledTriggers = "pull-request-created-trigger,pull-request-declined-trigger,branch-created-trigger,review-started-trigger,pull-request-merged-trigger,pull-request-reopened-trigger,commit-created-trigger,review-abandoned-trigger,review-approval-trigger,review-closed-trigger,review-rejected-trigger,review-summarized-trigger"
          }
          rule_key = "system:development-triggers"
        },
      ]
      type = "DIRECTED"
      validators = [
        {
          parameters = {
            conditionSelected = ">="
            date1FieldKey     = "customfield_10009"
            date2FieldKey     = "duedate"
            includeTime       = "true"
            ruleType          = "dateFieldComparison"
          }
          rule_key = "system:validate-field-value"
        },
        {
          parameters = {
            excludeSubtasks = "false"
            fieldKey        = "description"
            ruleType        = "fieldHasSingleValue"
          }
          rule_key = "system:validate-field-value"
        },
        /*
        {
          parameters = {
            "class.name"  = "com.atlassian.jira.workflow.validator.UserPermissionValidator"
            nullallowed   = "true"
            permissionKey = "BROWSE_PROJECTS"
            "vars.key"    = "name"
          }
          rule_key = "system:unsupported"   // This indicates taht validator module is not supported and will throw validation errors
        },
        */
        {
          parameters = null
          rule_key   = "system:proforma-forms-attached"
        },
        {
          parameters = {
            errorMessage   = "You got problems"
            fieldsRequired = "lastViewed"
            ignoreContext  = "true"
            ruleType       = "fieldRequired"
          }
          rule_key = "system:validate-field-value"
        },
        {
          parameters = {
            fieldKey = "customfield_10030"
            regexp   = "[0-9]+ EUR$"
            ruleType = "fieldMatchesRegularExpression"
          }
          rule_key = "system:validate-field-value"
        },
      ]
    }
    21 = {
      actions               = null
      conditions            = null
      custom_issue_event_id = null
      description           = null
      from = [
        {
          port             = 5
          status_reference = "10007"
        },
      ]
      name = "Done"
      properties = {
        "jira.i18n.submit" = "jira.issuetracking.simple.workflow.action.done.name"
        "jira.i18n.title"  = "jira.issuetracking.simple.workflow.action.done.name"
      }
      to = {
        port             = 0
        status_reference = "10002"
      }
      transition_screen = {
        parameters = {
          screenId = "10136"
        }
        rule_key = "system:transition-screen"
      }
      triggers   = null
      type       = "DIRECTED"
      validators = null
    }
    31 = {
      actions               = null
      conditions            = null
      custom_issue_event_id = null
      description           = null
      from = [
        {
          port             = 7
          status_reference = "3"
        },
      ]
      name = "Stop Progress"
      properties = {
        "jira.i18n.submit" = "stopprogress.title"
        "jira.i18n.title"  = "stopprogress.title"
      }
      to = {
        port             = 3
        status_reference = "10007"
      }
      transition_screen = null
      triggers          = null
      type              = "DIRECTED"
      validators        = null
    }
    41 = {
      actions = null
      conditions = {
        condition_groups = null
        conditions = [
          {
            condition_groups = null
            conditions       = null
            operation        = null
            parameters = {
              ignoreLoopTransitions = "false"
              includeCurrentStatus  = "false"
              mostRecentStatusOnly  = "false"
              not                   = "true"
              previousStatusIds     = "3"
            }
            rule_key = "system:previous-status-condition"
          },
        ]
        operation = "ALL"
      }
      custom_issue_event_id = null
      description           = null
      from = [
        {
          port             = 5
          status_reference = "3"
        },
      ]
      name = "Done"
      properties = {
        "jira.i18n.submit" = "jira.issuetracking.simple.workflow.action.done.name"
        "jira.i18n.title"  = "jira.issuetracking.simple.workflow.action.done.name"
      }
      to = {
        port             = 2
        status_reference = "10002"
      }
      transition_screen = null
      triggers          = null
      type              = "DIRECTED"
      validators        = null
    }
    51 = {
      actions               = null
      conditions            = null
      custom_issue_event_id = null
      description           = null
      from = [
        {
          port             = 7
          status_reference = "10002"
        },
      ]
      name = "Reopen"
      properties = {
        "jira.i18n.submit" = "jira.issuetracking.simple.workflow.action.reopen.name"
        "jira.i18n.title"  = "jira.issuetracking.simple.workflow.action.reopen.name"
      }
      to = {
        port             = 6
        status_reference = "10007"
      }
      transition_screen = null
      triggers          = null
      type              = "DIRECTED"
      validators        = null
    }
    61 = {
      actions = [
        {
          parameters = {
            type = "to-current-user"
          }
          rule_key = "system:change-assignee"
        },
      ]
      conditions            = null
      custom_issue_event_id = null
      description           = null
      from = [
        {
          port             = 3
          status_reference = "10002"
        },
      ]
      name = "Reopen and start progress"
      properties = {
        "jira.i18n.submit" = "jira.issuetracking.simple.workflow.action.reopenandstartprogress.name"
        "jira.i18n.title"  = "jira.issuetracking.simple.workflow.action.reopenandstartprogress.name"
      }
      to = {
        port             = 4
        status_reference = "3"
      }
      transition_screen = null
      triggers          = null
      type              = "DIRECTED"
      validators        = null
    }
    71 = {
      actions               = null
      conditions            = null
      custom_issue_event_id = null
      description           = null
      from                  = null
      name                  = "Approved"
      properties            = null
      to = {
        port             = 0
        status_reference = "10004"
      }
      transition_screen = null
      triggers          = null
      type              = "GLOBAL"
      validators        = null
    }
  }
}

Schema

Required

  • name (String) The name of the workflow. It can only be changed in inactive workflows.

Optional

  • description (String) he description of the workflow

  • scope (Attributes) The scope of the workflow. (see below for nested schema)

  • start_point_layout (Attributes) (see below for nested schema)

  • statuses (Attributes Set) The statuses to associate with the workflows. (see below for nested schema)

  • transitions (Attributes Map) The conditions group associated with the transition. (see below for nested schema)

Read-Only

  • id (String) The ID of the workflow.

  • last_updated (String) Timestamp of the last Terraform update of the Workflow resource.

  • version_id (String) Timestamp of the last Terraform update of the Workflow.

  • version_number (String) Timestamp of the last Terraform update of the Workflow.

Nested Schema for scope

Optional:

  • project (Attributes) (see below for nested schema)

  • type (String) The scope of the workflow. GLOBAL for company-managed projects and PROJECT for team-managed projects.

Nested Schema for scope.project

Optional:

  • id (String) The ID of associated project if workflow is used in team-managed project.

Nested Schema for start_point_layout

Optional:

  • x (Number) The ID Workflow.

  • y (Number) The ID Workflow.

Nested Schema for statuses

Optional:

  • deprecated (Boolean) Is set to false when status is in use. Set to true if status is going to be replaced.

  • layout (Attributes) Float number position (X,Y) of the status on workflow. (see below for nested schema)

  • properties (Map of String) Workflow status properties in form of key-value pair.

  • status_reference (String) The reference status ID.

Nested Schema for statuses.layout

Optional:

  • x (Number) Float number representing horizontal position of status on workflow diagram.

  • y (Number) Float number representing vertical position of status on workflow diagram.

Nested Schema for transitions

Optional:

  • actions (Attributes List) The post-functions of the transition. (see below for nested schema)

  • conditions (Attributes) (see below for nested schema)

  • custom_issue_event_id (String) The custom event ID of the transition.

  • description (String) Transition description.

  • from (Attributes Set) The statuses the transition can start from. (see below for nested schema)

  • name (String) Transition name

  • properties (Map of String) The properties of the transition. Key-value pairs.

  • to (Attributes) The status reference and port that a transition is connected to. (see below for nested schema)

  • transition_screen (Attributes) Transition screen associated with transition. (see below for nested schema)

  • triggers (Attributes List) The triggers of the transition. (see below for nested schema)

  • type (String) Transition type. Valid values: INITIAL, GLOBAL, DIRECTED

  • validators (Attributes List) The validators of the transition. (see below for nested schema)

Nested Schema for transitions.actions

Optional:

  • parameters (Map of String) The parameters related to the rule. Key-value pairs.

  • rule_key (String) Rule identifier/module.

Nested Schema for transitions.conditions

Optional:

  • condition_groups (Attributes List) The nested conditions of the condition group. (see below for nested schema)

  • conditions (Attributes List) The rules for this condition. (see below for nested schema)

  • operation (String) Determines how the conditions in the group are evaluated. Accepts either ANY or ALL. If ANY is used, at least one condition in the group must be true for the group to evaluate to true. If ALL is used, all conditions in the group must be true for the group to evaluate to true.

Nested Schema for transitions.conditions.condition_groups

Optional:

  • condition_groups (Attributes List) The nested conditions of the condition group. (see below for nested schema)

  • conditions (Attributes List) The nested rules for this condition. (see below for nested schema)

  • operation (String) Valid values: ANY, ALL

  • parameters (Map of String) Condition parameters key/value pairs.

  • rule_key (String) Condition rule key/module name.

Nested Schema for transitions.conditions.condition_groups.rule_key

Optional:

  • parameters (Map of String) Condition parameters key/value pairs.

  • rule_key (String) Condition rule key/module name.

Nested Schema for transitions.conditions.condition_groups.rule_key

Optional:

  • parameters (Map of String) Condition parameters key/value pairs.

  • rule_key (String) Condition rule key/module name.

Nested Schema for transitions.conditions.conditions

Optional:

  • condition_groups (Attributes List) The nested conditions of the condition group. (see below for nested schema)

  • conditions (Attributes List) The nested rules for this condition. (see below for nested schema)

  • operation (String) Valid values: ANY, ALL

  • parameters (Map of String) Condition parameters key/value pairs.

  • rule_key (String) Condition rule key/module name.

Nested Schema for transitions.conditions.conditions.rule_key

Optional:

  • parameters (Map of String) Condition parameters key/value pairs.

  • rule_key (String) Condition rule key/module name.

Nested Schema for transitions.conditions.conditions.rule_key

Optional:

  • parameters (Map of String) Condition parameters key/value pairs.

  • rule_key (String) Condition rule key/module name.

Nested Schema for transitions.from

Optional:

  • port (Number) The port on diagram (valid values 1-8) this transition uses to connect to this status.

  • status_reference (String) The ID reference of transition starting status.

Nested Schema for transitions.to

Optional:

  • port (Number) The port on diagram (valid values 1-8) this transition uses to connect to this status.

  • status_reference (String) The ID reference of transition ending status.

Nested Schema for transitions.transition_screen

Optional:

  • parameters (Map of String) Transition screen parameters

  • rule_key (String) Transition screen rule key.

Nested Schema for transitions.triggers

Optional:

  • parameters (Map of String) The parameters related to the rule. Key-value pairs.

  • rule_key (String) Rule identifier/module.

Nested Schema for transitions.validators

Optional:

  • parameters (Map of String) The parameters related to the rule. Key-value pairs.

  • rule_key (String) Rule identifier/module.