Skip to content

Test complex Jira workflows with Cucumber

When handling complex processes through Jira the maintenance and development of the necessary workflows can become increasingly hard. For example: A complicated process such as Release Management might have started with just one Jira issue on a multi-step workflow, but when being processed many subtasks (such as: approvals, validations, review, or installation tasks) might be needed to handle the process from start to end. After automating the inner-workings of the project a lot of dependencies exist, making testing increasingly frustrating. This is where using Behaviour Driven Testing with a tool like Cucumber can save a lot of time, and frustration.

Cucumber is an open-source tool intended to facilitate Behaviour-Driven Development. Cucumber’s specification language “Gherkin” is used to describe the behaviour expected from a Jira workflow. Using specific key-words, it describes the step by step behaviour of what is expected from the workflow under the given circumstances. Easily testing all the scenarios, even those that are only slight variations of one another. This way a small change in the permission scheme or a newly developed automated step in the process can be tested immediately and completely.

Limiting the amount of work getting “stuck in the system” and the amount of requests the Jira administrators have to handle when the users find out that the workflow behaves unexpectedly, and more importantly this saves a lot of time on tedious manual testing. No more need to create issues manually and guide them through all possible variations of your workflow and all the sub-task workflows, all the while having to change users at various steps of the process. The reduced time alone from not having to test manually by setting up the Cucumber tests is a great win.

On the back-end side of Cucumber the communication with Jira is effortless because of the possibilities to create, transition and edit Jira issues through the Jira REST APIs. Thanks to these possibilities Cucumber can actually create and transition tickets on a Jira test environment, and then use the similar APIs to test whether the issue follows business logic.

To give an example a Cucumber scenario could look like this:

In this example the first scenario completes successfully but the second scenario fails, giving a clear error message and enough information for the user to quickly find the source of the problem.

When one of the “Product Owners” (a group within Jira) creates a new issue called “Release Request”, two subtasks have to be created automatically, and the subtasks associated with this “Release Request” should be assigned to someone in the group “Developers”. Then the described behaviour is translated to a Cucumber Scenario using Steps from our Step Library. If for example the subtasks are not assigned after creation, Cucumber will notify that the data found does not match what is described (assignees for the subtasks, as well as them being part of the Developers group), and will also show what data is found. Thanks to this easy scenario the Jira administrator can easily find out that the workflow is not functioning as expected and add the necessary features to it.

Using Cucumber in this way makes managing all kinds of complex processes within Jira workflows possible, without creating hard to maintain projects for Jira that require a lot of manual testing to see if the automation functions work as intended. Go to https://cucumber.io/ (or click here to download Cucumber’s BDD Benefits) for more information on Cucumber, and use a Behaviour Driven Development method the next time an ambitious process needs to make its way to your Jira instance!

More about Agile IT with DevOps

Implementing DevOps creates the mind-set, tools & processes to turn ideas rapidly into new and enhanced features. With 50 certified DevOps consultants we help our clients in winning their digital battles every day.

Other relevant DevOps content