This resource represents workflow transition rules. Workflow transition rules define a Connect or a Forge app routine, such as a workflow post functions that is executed in association with the workflow. Use it to read and modify configuration of workflow transition rules.

Hierarchy

  • CommonHttpService
    • WorkflowTransitionRulesService

Constructors

  • Internal

    Create a new instance of the service.

    Parameters

    • getClientInstance: (() => CommonHttpClient)
        • (): CommonHttpClient
        • Returns CommonHttpClient

    Returns WorkflowTransitionRulesService

Methods

  • Deletes workflow transition rules from one or more workflows. These rule types are supported:

    conditions * validators

    Only rules created by the calling Connect app can be deleted.

    Permissions required: Only Connect apps can use this operation.

    Parameters

    • params: {
          workflowsWithTransitionRulesDetails: WorkflowsWithTransitionRulesDetails;
      }
      • workflowsWithTransitionRulesDetails: WorkflowsWithTransitionRulesDetails
        {
        "workflows": [
        {
        "workflowId": {
        "draft": false,
        "name": "Internal support workflow"
        },
        "workflowRuleIds": [
        "b4d6cbdc-59f5-11e9-8647-d663bd873d93",
        "d663bd873d93-59f5-11e9-8647-b4d6cbdc",
        "11e9-59f5-b4d6cbdc-8647-d663bd873d93"
        ]
        }
        ]
        }

    Returns Promise<WorkflowTransitionRulesUpdateErrors>

    Returned if the request is successful.

    example:

    {
    "updateResults": [
    {
    "workflowId": {
    "name": "Workflow with one rule not updated",
    "draft": false
    },
    "ruleUpdateErrors": {
    "example-rule-id": [
    "The rule with this id does not exist: example-rule-id"
    ]
    },
    "updateErrors": []
    },
    {
    "workflowId": {
    "name": "Workflow with all rules successfully updated",
    "draft": true
    },
    "ruleUpdateErrors": {},
    "updateErrors": []
    },
    {
    "workflowId": {
    "name": "Non-existing workflow",
    "draft": false
    },
    "ruleUpdateErrors": {},
    "updateErrors": [
    "Workflow not found: WorkflowIdBean{name=Non-existing workflow, draft=false}"
    ]
    }
    ]
    }
  • Returns a paginated list of workflows with transition rules. The workflows can be filtered to return only those containing workflow transition rules:

    • of one or more transition rule types, such as workflow post functions.
    • matching one or more transition rule keys.

    Only workflows containing transition rules created by the calling Connect or Forge app are returned.

    Due to server-side optimizations, workflows with an empty list of rules may be returned; these workflows can be ignored.

    Permissions required: Only Connect or Forge apps can use this operation.

    Parameters

    • params: {
          draft?: boolean;
          expand?: string;
          keys?: string[];
          maxResults?: number;
          startAt?: number;
          types: ("postfunction" | "condition" | "validator")[];
          withTags?: string[];
          workflowNames?: string[];
      }
      • Optionaldraft?: boolean

        Whether draft or published workflows are returned. If not provided, both workflow types are returned.

      • Optionalexpand?: string

        Use expand to include additional information in the response. This parameter accepts transition, which, for each rule, returns information about the transition the rule is assigned to.

      • Optionalkeys?: string[]

        The transition rule class keys, as defined in the Connect or the Forge app descriptor, of the transition rules to return.

      • OptionalmaxResults?: number

        The maximum number of items to return per page.

      • OptionalstartAt?: number

        The index of the first item to return in a page of results (page offset).

      • types: ("postfunction" | "condition" | "validator")[]

        The types of the transition rules to return.

      • OptionalwithTags?: string[]

        The list of tags to filter by.

      • OptionalworkflowNames?: string[]

        The list of workflow names to filter by.

    Returns Promise<PageBeanWorkflowTransitionRules>

    Returned if the request is successful.

    example:

    {
    "isLast": true,
    "maxResults": 10,
    "startAt": 0,
    "total": 1,
    "values": [
    {
    "workflowId": {
    "name": "My Workflow name",
    "draft": false
    },
    "postFunctions": [
    {
    "id": "b4d6cbdc-59f5-11e9-8647-d663bd873d93",
    "key": "postfunction-key",
    "configuration": {
    "value": "{ \"color\": \"red\" }",
    "disabled": false,
    "tag": "Sample tag"
    },
    "transition": {
    "id": 1,
    "name": "Open"
    }
    }
    ],
    "conditions": [
    {
    "id": "d663bd873d93-59f5-11e9-8647-b4d6cbdc",
    "key": "condition-key",
    "configuration": {
    "value": "{ \"size\": \"medium\" }",
    "disabled": false,
    "tag": "Another tag"
    },
    "transition": {
    "id": 1,
    "name": "Open"
    }
    }
    ],
    "validators": [
    {
    "id": "11e9-59f5-b4d6cbdc-8647-d663bd873d93",
    "key": "validator-key",
    "configuration": {
    "value": "\"{ \\\"shape\\\": \\\"square\\\" }\"",
    "disabled": false
    },
    "transition": {
    "id": 1,
    "name": "Open"
    }
    }
    ]
    }
    ]
    }

    GET /rest/api/3/workflow/rule/config @scopes-current manage:jira-configuration @scopes-beta read:workflow:jira

  • Updates configuration of workflow transition rules. The following rule types are supported:

    conditions * validators

    Only rules created by the calling Connect or Forge app can be updated.

    To assist with app migration, this operation can be used to:

    Rules are enabled if the disabled parameter is not provided.

    Permissions required: Only Connect or Forge apps can use this operation.

    Parameters

    • params: {
          workflowTransitionRulesUpdate: WorkflowTransitionRulesUpdate;
      }
      • workflowTransitionRulesUpdate: WorkflowTransitionRulesUpdate
        {
        "workflows": [
        {
        "conditions": [
        {
        "configuration": {
        "disabled": false,
        "tag": "Another tag",
        "value": "{ \"size\": \"medium\" }"
        },
        "id": "d663bd873d93-59f5-11e9-8647-b4d6cbdc"
        }
        ],
        "postFunctions": [
        {
        "configuration": {
        "disabled": false,
        "tag": "Sample tag",
        "value": "{ \"color\": \"red\" }"
        },
        "id": "b4d6cbdc-59f5-11e9-8647-d663bd873d93"
        }
        ],
        "validators": [
        {
        "configuration": {
        "disabled": false,
        "value": "{ \"shape\": \"square\" }"
        },
        "id": "11e9-59f5-b4d6cbdc-8647-d663bd873d93"
        }
        ],
        "workflowId": {
        "draft": false,
        "name": "My Workflow name"
        }
        }
        ]
        }

    Returns Promise<WorkflowTransitionRulesUpdateErrors>

    Returned if the request is successful.

    example:

    {
    "updateResults": [
    {
    "workflowId": {
    "name": "Workflow with one rule not updated",
    "draft": false
    },
    "ruleUpdateErrors": {
    "example-rule-id": [
    "The rule with this id does not exist: example-rule-id"
    ]
    },
    "updateErrors": []
    },
    {
    "workflowId": {
    "name": "Workflow with all rules successfully updated",
    "draft": true
    },
    "ruleUpdateErrors": {},
    "updateErrors": []
    },
    {
    "workflowId": {
    "name": "Non-existing workflow",
    "draft": false
    },
    "ruleUpdateErrors": {},
    "updateErrors": [
    "Workflow not found: WorkflowIdBean{name=Non-existing workflow, draft=false}"
    ]
    }
    ]
    }

    PUT /rest/api/3/workflow/rule/config @scopes-current manage:jira-configuration @scopes-beta write:workflow:jira

  • Method to initialize the class. Normally used to set up validation rules.

    Returns void