Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,367,393
Community Members
 
Community Events
168
Community Groups

Assigning issues to sprints when importing with Json

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

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"

            }

          ]

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

Atlassian Community Events