Hi folks! I’m in need of generating a data set in our test Jira instance to assist in the development of a Forge application.
Here are some general requirements:
- Create issues that span a whole year to simulate quarterly work e.g. 5 issues between Jan-March, 7 issues between June-Sept, etc.
- Have specific status transitions for these issues that span a certain number of days e.g. spend 2 days in status 1, spend 5 days in status 2, etc.
Is it possible to automatically create this kind of test data through the API or data import?
Hello @FernandoMartinez
When you say “Create issues that span a whole year”, do you mean the Issues have the date / time of their created field set into a range that can be the past and future?
If so, you cannot use the REST API to manipulate the change log that records the date / time when Issues are created or their status changed, so you cannot artificially simulate the creating of Issues in the past or the future, nor the passing of time between status changes.
Google ‘jira cloud rest api create issue in future date’ to see where that question has been asked before and also the corresponding feature request JRACLOUD-38572.
HOWEVER, if you read the feature request you’ll find that when an doing external system import with JSON data, you can set the created field and at least set the creation date / time for Issues.
@sunnyape Thanks! I was able to import issues and re-create a historical data set.
I have a follow up problem. The imported issues are not showing up in JQL queries while the ones I manually create and transition through the UI do. I’m using JQL like project = "INIT" AND type = "Functional Bet" AND status WAS IN ("Ideation", "Early Access")
, and both the manual and imported issues have the status transitions in their history but they are rendered differently:
Manual
Imported
Do you have any debugging ideas?
Hello @FernandoMartinez
Depending on all the possible configurations you put in the JSON file, after you import the raw Issues, there are many more things that need to be done to the Project to link all the remaining functionality together to ‘bring it to life’, such as matching up the imported Statuses to pre-existing statuses etc.
Also, JQL operators like WAS IN
are dependant on the Issue history (change log). If you imported Issues with future created dates, or no history as to what sprints they have been part of in the past, then that JQL search will not work for those Issues.
Those sort of general questions about how to configure and manage Project features and how JQL works are best asked on the public Community Forum.