Thanks for your suggestion, David. We will get to returning drafts eventually
Meanwhile, we just added a new feature: a possibility to retrieve all rules (validators, conditions and post-functions) along with workflow transitions.
GET /rest/api/2/workflow/search?expand=transitions.rules
Example response:
{
"maxResults": 50,
"startAt": 0,
"total": 1,
"isLast": true,
"values": [
{
"id": {
"name": "Builds Workflow"
},
"description": "Builds Workflow",
"transitions": [
{
"id": "701",
"name": "Close Issue",
"description": "Closing an issue indicates there is no more work to be done on it, and it has been verified as complete.",
"from": [
"5"
],
"to": "6",
"type": "directed",
"rules": {
"conditions": [
{
"type": "PermissionCondition",
"configuration": {
"permissionKey": "CLOSE_ISSUES"
}
}
],
"validators": [
{
"type": "connect.app.key__validator_key",
"configuration": {
"value": "config as stored by the app",
"id": "UUID"
}
}
],
"postFunctions": [
{
"type": "UpdateIssueStatusFunction"
},
{
"type": "CreateCommentFunction"
},
{
"type": "GenerateChangeHistoryFunction"
},
{
"type": "IssueReindexFunction"
},
{
"type": "FireIssueEventFunction"
}
]
}
}]}
]}
Not all rules are fully supported in the initial release, which means for some we won’t be returning any configuration, just the type (which should still be fairly useful).
Fully supported rules at this time are:
- All connect conditions, validators and post-functions
- FieldRequiredValidator
- PermissionValidator
- UserPermissionValidator
- PermissionCondition
Let us know if you would like to be able to retrieve full configuration of any other type of rules.