New Workflow REST APIs in Jira Cloud

Hi everyone,

I’m happy to announce that we’ve recently introduced two long-awaited REST resources for retrieving information about Jira Workflows, namely:

Read more about these two and the use cases they enable in our developer blog: Make work flow with the new Jira Cloud workflow APIs.

Looking forward to hearing your feedback. If you would like to see more features related to workflows, feel free to create new ACJIRA issues or describe it here.

7 Likes

Hi @kkercz,
this is great, thanks!
I have created https://ecosystem.atlassian.net/browse/ACJIRA-1919 for an improvement: be able to get draft workflows as well.

2 Likes

Thanks for your suggestion, David. We will get to returning drafts eventually :slight_smile:

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.

1 Like