I'm trying to import issues with sprint information, per the documentation here.
This is just the example from the above link - Jira's own documentation. There's a typo in the original (unclosed quotation) which I've fixed here. If I run this through the json importer:
{
"projects": [
{
"name": "Project",
"key": "KEY",
"issues": [
{
"externalId": "51",
"priority" : "High",
"description" : "Test JSON import",
"status" : "TO DO",
"reporter" : "abcde-12345-fedcba",
"issueType" : "Bug",
"summary" : "Test JSON import",
"customFieldValues": [
{
"fieldName": "Sprint",
"fieldType": "com.pyxis.greenhopper.jira:gh-sprint",
"value": [
{
"rapidViewId": 30,
"state": CLOSED",
"startDate": "2018-01-01",
"endDate": "2018-01-01",
"completeDate": "2018-01-01",
"name": "New Sprint"
}
]
}
]
}
]
}
]
}
I get the following error:
2023-07-21 21:42:17,718 WARN - Cannot add value [ [{rapidViewId=30, state=CLOSED, startDate=2018-01-01, endDate=2018-01-01, completeDate=2018-01-01, name=New Sprint}] ] to CustomField Sprint in Issue with summary 'Test JSON import'. Probably value was in incorrect format
And of course none of my own data works, either.
Any ideas???
Hi @Randall Hink,
Do you have the board with rapidViewId = 30? To check this, open the URL: https://YOUR_JIRA/secure/RapidBoard.jspa?rapidView=30
It's necessary to use the ID of the existing board.
Thank you for the response!
At your recommendation, I changed the rapidViewId to match a board that does exist - and I still get the same error, unfortunately.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Randall Hink, sorry for misleading. I've just tried to create active and closed sprints and failed. But this works for creating future sprints (even there's no need to change rapidViewId):
{
"projects": [
{
"name": "Project",
"key": "KEY",
"issues": [
{
"externalId": "51",
"priority" : "High",
"description" : "Test JSON import",
"status" : "TO DO",
"reporter" : "abcde-12345-fedcba",
"issueType" : "Bug",
"summary" : "Test JSON import",
"customFieldValues": [
{
"fieldName" : "Sprint",
"fieldType" : "com.pyxis.greenhopper.jira:gh-sprint",
"searcherType" : "com.pyxis.greenhopper.jira:gh-sprint-searcher",
"value" : [ {
"id" : 10,
"rapidViewId" : 30,
"state" : "FUTURE",
"name" : "TEST SPRINT",
"startDate" : "2023-01-01",
"endDate" : "2023-01-01",
"sequence" : 10,
"autoStartStop" : false,
"synced" : false,
"future" : true,
"closed" : false,
"active" : false
} ]
} ]
} ]
} ]
}
I don't get what values should I add to create closed sprints, because adding "completeDate" and "activatedDate" doesn't work.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
No problem, I sincerely appreciate the help.
I definitely need to be able to create closed sprints; I'm migrating current and historical data from another system.
I think I'm just going to work around it using the REST API to script sprint creation instead:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
So it's a little bit convoluted, and maybe there's an easier way to do it, but here's what ended up working for me:
What I end up uploading into Jira looks something like this:
{
"projects": [
{
"name": "Project",
"key": "KEY",
"issues": [
{
"externalId": "51",
"priority" : "High",
"description" : "Test JSON import",
"status" : "TO DO",
"reporter" : "abcde-12345-fedcba",
"issueType" : "Bug",
"summary" : "Test JSON import",
"customFieldValues": [
{
"fieldName": "Sprint",
"fieldType": "com.pyxis.greenhopper.jira:gh-sprint",
"value": 42
}
]
}
]
}
]
}
Note the "42" value in the custom field value comes from the JSON retrieved from the Jira REST API board/{boardId}/sprint endpoint, which would look something like this:
{
"maxResults": 2,
"startAt": 1,
"total": 5,
"isLast": false,
"values": [
{
"id": 42,
"self": "https://your-domain.atlassian.net/rest/agile/1.0/sprint/23",
"state": "closed",
"name": "sprint 1",
"startDate": "2015-04-11T15:22:00.000+10:00",
"endDate": "2015-04-20T01:22:00.000+10:00",
"completeDate": "2015-04-20T11:04:00.000+10:00",
"originBoardId": 5,
"goal": "sprint 1 goal"
}
]
}
If there's a way to actually create the sprints and associate them via JSON import, I haven't figured it out.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.