And on the first day, the tester created tasks: a great way to setup your tasks and bootstrap data (if needed) for JIRA Automation.
Where do I start from
If you’re looking for an answer to this question, you came to the right place! In this part of the article, we will show you how to setup everything for JIRA automation, step by step.
So, let’s say you’ve started a JIRA project and paid a huge amount of money to have the access to XRay JIRA extension for task management. The first thing you’ll notice is that you have new types of tasks available for creation in JIRA: tasks such as test plan, test set, test, etc.
A good practice would be to create a test plan task first, because it encapsulates all of the tests you’ll be performing during the testing phase. Our general practice is to open a new test plan (or, in some cases, re-open it) for different stages or releases of the product. So, we may have one test plan dealing with regression tests, one test plan which includes new features exclusively, etc. Basically, it depends on your personal preferences, as well as the company policy concerning testing strategy.

The next step would be to create either test sets or tests. We’ve decided the best solution for organizing things during the testing phase is grouping tests into test sets. This way, everything can be categorized based on specific features. XRay also offers you a possibility to create precondition tasks for each test and also to write your test steps as a manual test, a Cucumber test, etc.
Once you’ve created your test plan and test sets that you’ve integrated into the test plan, it’s time to create a test execution task. A test execution task is what it’s actually being executed when doing JIRA automation. Our practice is to associate all the tests in a test plan with a test execution belonging to that test plan. However, this is by no means a necessity – you can create a test execution task which includes a smaller portion of tests, or even tests that are not part of the test plan.

When you’ve created the test execution task and associated your tests with it, you will notice that tests within the test execution can be “played”, which means they can be set as “PASS”, “FAIL”, etc. This is the part that we will actually be automating.
But I want to automate task creation as well!
It’s quite clear that our way of automating JIRA still includes manual steps and it’s not fully automated (oh dear!). You are probably wondering: why not create tasks automatically, considering that JIRA tasks can be both created and updated remotely?
Well, that can be explained. We’ve decided to pursue this automation logic because the alternative was to either overload the test execution task with a number of identical test task copies or to create a new test execution each time test run is started, which would, in time, create an enormous amount of identical test execution tasks.
The happiest solution is perhaps to create a piece of code which checks whether the test execution and tests already exist and then either creates new ones or modifies the existing ones. But that seemed as way too complex way to do the simple JIRA automation. Moreover, the fact remains that you would still have to enter all the task data into your code, which is basically the same thing as entering it manually into JIRA. If not the best, our solution is at least very clean.
Bootstrapping data
Let’s go quickly through bootstrapping data. First of all, it should be emphasized that bootstrapping data is not mandatory, but depends on the nature of the project and, of course, your own way of testing.
If you’re wondering what bootstrapping data means, it refers to the data we need to have entered in the database before our test run is started. It’s usually some kind of user entity, or something that the end user requires to complete the test successfully. While you may add the data during your UI click test, this practice is considered by many as unnecessary, because it prolongs the test run and is usually not part of the functionality being tested. Therefore, it’s easier to do it by seeding the database or by filling up the database via API requests or something similar.
In any case, if you’re bootstrapping data, now’s the time to do it.
What next?
Well, I guess this is the end of part 2, there’s not much more to be said about task creation in JIRA (and XRay). If you still want to know more, there are great JIRA resources which can be found at this URL.
Also, if you’re interested to know more about XRay, try here.
In the next part of the article, we will be dealing with executing Cypress click tests and exporting the test results to a JSON file using Mocha tools.