readWorkflowFromHistory
Read workflow version from history
Details
- Method:
POST - Path:
/rest/api/3/workflow/history - Operation ID:
readWorkflowFromHistory
Parameters
{
"version": {
"description": "",
"required": false,
"location": "body",
"type": "integer"
},
"workflowId": {
"description": "",
"required": false,
"location": "body",
"type": "string"
}
}Response Schema
{
"additionalProperties": false,
"description": "The specified workflow version read from history.",
"properties": {
"statuses": {
"items": {
"additionalProperties": false,
"description": "The statuses stored for the specified version.",
"properties": {
"description": {
"type": "string"
},
"id": {
"type": "string"
},
"name": {
"type": "string"
},
"scope": {
"additionalProperties": false,
"description": "The scope of the workflow.",
"properties": {
"project": {
"additionalProperties": false,
"description": "Project ID details.",
"nullable": true,
"properties": {
"id": {
"description": "The ID of the project.",
"type": "string"
}
},
"required": [
"id"
],
"type": "object"
},
"type": {
"description": "The scope of the workflow. `GLOBAL` for company-managed projects and `PROJECT` for team-managed projects.",
"enum": [
"PROJECT",
"GLOBAL"
],
"type": "string"
}
},
"type": "object"
},
"statusCategory": {
"type": "string"
},
"statusReference": {
"type": "string"
}
},
"type": "object"
},
"type": "array",
"uniqueItems": true
},
"workflows": {
"items": {
"additionalProperties": false,
"description": "The workflow stored for the specified version.",
"properties": {
"created": {
"type": "string"
},
"description": {
"type": "string"
},
"id": {
"type": "string"
},
"lastUpdateAuthorAAID": {
"type": "string"
},
"loopedTransitionContainerLayout": {
"additionalProperties": false,
"description": "The starting point for the statuses in the workflow.",
"nullable": true,
"properties": {
"x": {
"description": "The x axis location.",
"format": "double",
"type": "number"
},
"y": {
"description": "The y axis location.",
"format": "double",
"type": "number"
}
},
"type": "object"
},
"name": {
"type": "string"
},
"scope": {
"additionalProperties": false,
"description": "The scope of the workflow.",
"properties": {
"project": {
"additionalProperties": false,
"description": "Project ID details.",
"nullable": true,
"properties": {
"id": {
"description": "The ID of the project.",
"type": "string"
}
},
"required": [
"id"
],
"type": "object"
},
"type": {
"description": "The scope of the workflow. `GLOBAL` for company-managed projects and `PROJECT` for team-managed projects.",
"enum": [
"PROJECT",
"GLOBAL"
],
"type": "string"
}
},
"type": "object"
},
"startPointLayout": {
"additionalProperties": false,
"description": "The starting point for the statuses in the workflow.",
"nullable": true,
"properties": {
"x": {
"description": "The x axis location.",
"format": "double",
"type": "number"
},
"y": {
"description": "The y axis location.",
"format": "double",
"type": "number"
}
},
"type": "object"
},
"statuses": {
"items": {
"additionalProperties": false,
"description": "The statuses referenced in the workflow.",
"properties": {
"approvalConfiguration": {
"additionalProperties": false,
"description": "The approval configuration of a status within a workflow. Applies only to Jira Service Management approvals.",
"nullable": true,
"properties": {
"active": {
"description": "Whether the approval configuration is active.",
"enum": [
"true",
"false"
],
"type": "string"
},
"conditionType": {
"description": "How the required approval count is calculated. It may be configured to require a specific number of approvals, or approval by a percentage of approvers. If the approvers source field is Approver groups, you can configure how many approvals per group are required for the request to be approved. The number will be the same across all groups.",
"enum": [
"number",
"percent",
"numberPerPrincipal"
],
"type": "string"
},
"conditionValue": {
"description": "The number or percentage of approvals required for a request to be approved. If `conditionType` is `number`, the value must be 20 or less. If `conditionType` is `percent`, the value must be 100 or less.",
"type": "string"
},
"exclude": {
"description": "A list of roles that should be excluded as possible approvers.",
"items": {
"description": "A list of roles that should be excluded as possible approvers.",
"enum": [
"assignee",
"reporter"
],
"nullable": true,
"type": "string"
},
"nullable": true,
"type": "array"
},
"fieldId": {
"description": "The custom field ID of the \"Approvers\" or \"Approver Groups\" field.",
"type": "string"
},
"prePopulatedFieldId": {
"description": "The custom field ID of the field used to pre-populate the Approver field. Only supports the \"Affected Services\" field.",
"nullable": true,
"type": "string"
},
"transitionApproved": {
"description": "The numeric ID of the transition to be executed if the request is approved.",
"type": "string"
},
"transitionRejected": {
"description": "The numeric ID of the transition to be executed if the request is declined.",
"type": "string"
}
},
"required": [
"active",
"conditionType",
"conditionValue",
"fieldId",
"transitionApproved",
"transitionRejected"
],
"type": "object"
},
"deprecated": {
"description": "Indicates if the status is deprecated.",
"type": "boolean"
},
"layout": {
"additionalProperties": false,
"description": "The x and y location of the status in the workflow.",
"nullable": true,
"properties": {
"x": {
"description": "The x axis location.",
"format": "double",
"nullable": true,
"type": "number"
},
"y": {
"description": "The y axis location.",
"format": "double",
"nullable": true,
"type": "number"
}
},
"type": "object"
},
"properties": {
"additionalProperties": {
"description": "The properties associated with the status.",
"type": "string"
},
"description": "The properties associated with the status.",
"type": "object"
},
"statusReference": {
"description": "The reference of the status.",
"type": "string"
}
},
"type": "object"
},
"type": "array",
"uniqueItems": true
},
"transitions": {
"items": {
"additionalProperties": false,
"description": "The transitions of the workflow.",
"properties": {
"actions": {
"description": "The post-functions of the transition.",
"items": {
"additionalProperties": false,
"description": "The configuration of the rule.",
"nullable": true,
"properties": {
"id": {
"description": "The ID of the rule.",
"nullable": true,
"type": "string"
},
"parameters": {
"additionalProperties": {
"description": "The parameters related to the rule.",
"type": "string"
},
"description": "The parameters related to the rule.",
"type": "object"
},
"ruleKey": {
"description": "The rule key of the rule.",
"type": "string"
}
},
"required": [
"ruleKey"
],
"type": "object"
},
"type": "array"
},
"conditions": {
"additionalProperties": false,
"description": "The conditions group associated with the transition.",
"nullable": true,
"properties": {
"conditionGroups": {
"description": "The nested conditions of the condition group.",
"items": {
"type": "object",
"description": "Circular reference"
},
"type": "array"
},
"conditions": {
"description": "The rules for this condition.",
"items": {
"additionalProperties": false,
"description": "The configuration of the rule.",
"nullable": true,
"properties": {
"id": {
"description": "The ID of the rule.",
"nullable": true,
"type": "string"
},
"parameters": {
"additionalProperties": {
"description": "The parameters related to the rule.",
"type": "string"
},
"description": "The parameters related to the rule.",
"type": "object"
},
"ruleKey": {
"description": "The rule key of the rule.",
"type": "string"
}
},
"required": [
"ruleKey"
],
"type": "object"
},
"type": "array"
},
"operation": {
"description": "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.",
"enum": [
"ANY",
"ALL"
],
"type": "string"
}
},
"type": "object"
},
"customIssueEventId": {
"description": "The custom event ID of the transition.",
"nullable": true,
"type": "string"
},
"description": {
"description": "The description of the transition.",
"type": "string"
},
"id": {
"description": "The ID of the transition.",
"type": "string"
},
"links": {
"description": "The statuses the transition can start from, and the mapping of ports between the statuses.",
"items": {
"additionalProperties": false,
"description": "The statuses the transition can start from, and the mapping of ports between the statuses.",
"nullable": true,
"properties": {
"fromPort": {
"description": "The port that the transition starts from.",
"format": "int32",
"nullable": true,
"type": "integer"
},
"fromStatusReference": {
"description": "The status that the transition starts from.",
"nullable": true,
"type": "string"
},
"toPort": {
"description": "The port that the transition goes to.",
"format": "int32",
"nullable": true,
"type": "integer"
}
},
"type": "object"
},
"type": "array"
},
"name": {
"description": "The name of the transition.",
"type": "string"
},
"properties": {
"additionalProperties": {
"description": "The properties of the transition.",
"type": "string"
},
"description": "The properties of the transition.",
"type": "object"
},
"toStatusReference": {
"description": "The status the transition goes to.",
"type": "string"
},
"transitionScreen": {
"additionalProperties": false,
"description": "The configuration of the rule.",
"nullable": true,
"properties": {
"id": {
"description": "The ID of the rule.",
"nullable": true,
"type": "string"
},
"parameters": {
"additionalProperties": {
"description": "The parameters related to the rule.",
"type": "string"
},
"description": "The parameters related to the rule.",
"type": "object"
},
"ruleKey": {
"description": "The rule key of the rule.",
"type": "string"
}
},
"required": [
"ruleKey"
],
"type": "object"
},
"triggers": {
"description": "The triggers of the transition.",
"items": {
"additionalProperties": false,
"description": "The trigger configuration associated with a workflow.",
"properties": {
"id": {
"description": "The ID of the trigger.",
"type": "string"
},
"parameters": {
"additionalProperties": {
"description": "The parameters of the trigger.",
"type": "string"
},
"description": "The parameters of the trigger.",
"type": "object"
},
"ruleKey": {
"description": "The rule key of the trigger.",
"type": "string"
}
},
"required": [
"parameters",
"ruleKey"
],
"type": "object"
},
"type": "array"
},
"type": {
"description": "The transition type.",
"enum": [
"INITIAL",
"GLOBAL",
"DIRECTED"
],
"type": "string"
},
"validators": {
"description": "The validators of the transition.",
"items": {
"additionalProperties": false,
"description": "The configuration of the rule.",
"nullable": true,
"properties": {
"id": {
"description": "The ID of the rule.",
"nullable": true,
"type": "string"
},
"parameters": {
"additionalProperties": {
"description": "The parameters related to the rule.",
"type": "string"
},
"description": "The parameters related to the rule.",
"type": "object"
},
"ruleKey": {
"description": "The rule key of the rule.",
"type": "string"
}
},
"required": [
"ruleKey"
],
"type": "object"
},
"type": "array"
}
},
"type": "object"
},
"type": "array",
"uniqueItems": true
},
"updated": {
"type": "string"
},
"version": {
"additionalProperties": false,
"description": "The current version details of this workflow scheme.",
"properties": {
"id": {
"description": "The version UUID.",
"type": "string"
},
"versionNumber": {
"description": "The version number.",
"format": "int64",
"type": "integer"
}
},
"type": "object"
}
},
"type": "object"
},
"type": "array",
"uniqueItems": true
}
},
"type": "object"
}Usage
from ocp_agent import OCPAgent
agent = OCPAgent()
await agent.register_api('jira')
# Call this tool
result = await agent.call_tool('readWorkflowFromHistory', {
# Add required parameters here
})