Assigning issues to sprints when importing with Json

Urs August 8, 2022

I import Jira issues to a cloud database via Json in the following way:

{
"projects": [
{
"key": "SOMEKEY",
"issues": [
{
"externalId": "4711",
"issueType": "Example",
"summary": "Example summary 1",
"description": "Example description 1"
}
]
}
]
}

This is working fine.

What I am trying now is to assign those issues to an existing sprint. I have found something like this:

{
"projects": [
{
"key": "SOMEKEY",
"issues": [
{
"externalId": 4711,
"issueType": "Example",
"summary": "Example summary 1",
"description": "Example description 1",
"customFieldValues": [
{
"fieldName": "Sprint",
"fieldType": "com.pyxis.greenhopper.jira:gh-sprint",
"value": [
{
"rapidViewId": 78,
"state": "CLOSED",
"startDate": "2018-01-01",
"endDate": "2018-01-01",
"completeDate": "2018-01-01",
"name": "New Sprint"
}
]
}
]
}
]
}
]
}

As far as I understood that the "rapidViewId" should be the ID of a board.

If I import this I get the following log message:

INFO - Importing: Issues
INFO - ------------------------------
INFO - Only new items will be imported
INFO - Importing issue: [externalId='4719', summary='Example summary 1']
WARN - Cannot add value [ [{rapidViewId=78, state=CLOSED, startDate=2018-01-01, endDate=2018-01-01, completeDate=2018-01-01, name=New Sprint}] ] to CustomField Sprint in Issue with summary 'Example summary 1': null
INFO - 1 issues successfully created
INFO - ------------------------------

As a result the issue itself is imported but neither a association to a sprint nor a new sprint. I have tried several things but I did not find a way to assign the issue to a sprint.

Can anybody help ?

Thx in advance.

 

2 answers

1 vote
Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
August 8, 2022

Hello @Urs 

I have not worked with JSON import before, but it seems to me the example is only for creating a new Sprint as part of the import.

I did some experimenting and found that I could import an issue and assign it to a pre-existing sprint by providing the Sprint ID, like this:

          "customFieldValues": [

            {

              "fieldName": "Sprint",

              "fieldType": "com.pyxis.greenhopper.jira:gh-sprint",

              "value": "8"

            }

          ]
0 votes
David Bakkers
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 8, 2022

Hello @Urs 

Instead of assigning sprints to issues, do it the other way around and assign issues to sprints.

Refer to the Jira Software Cloud Move issues to sprint and rank endpoint documentation for the parameters that endpoint supports and the JSON format of the body of the request.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
PERMISSIONS LEVEL
Site Admin
TAGS
AUG Leaders

Atlassian Community Events