Import/Add history and comments for existing issues through JSON

I am trying to import and add history entries and comments for existing issues through JSON. I know how to properly write JSON for history and comments, but struggle with referencing the existing issues. 

I thought, the JSON file would simply reference the existing issue's key:

{
	"projects": [
		{
			"key": "PRJ",
			"issues": [
				{
					"key": "PRJ-222",
					"history": [ ... ],
					"comments": [ ... ]
				}
			]
		}
	]
}

However, importing this fails claiming that no summary is set. If I provide the existing summary in the JSON file, then the import succeeds, but clears all other fields in the issues (such as fixVersion, components, etc.).

How do I correctly import and add the elements without overwriting the issue?

1 answer

Hi, I use JSON import regularly to add comments to existing issues, and it works fine, leaving the other fields unchanged (using the JSON structure as you describe). I did not try to add history items yet.

I think even that if you add the summary field, it will simply overwrite the summary field but never clear the other fields ??? (to be clear: I never tried this)

I did a quick test: here's my JSON file

{"projects": [{"issues": [{"comments": [{"body": "This is my test comment"}],
                           "key": "MUL-2128"}
                         ],
                "key": "MUL"}
            ]
}

It says : No errors, "no Issues and projects imported". But the comment was added correctly to my issue.

I am using JIRA 6.3.12 (know there are improvements in this area in the different 6.x versions)

Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Julia Dillon
Posted Tuesday in Jira

Tell us how your team runs on Jira!

Hey Atlassian Community! Today we are launching a bunch of customer stories about the amazing work teams, like Dropbox and Twilio, are doing with Jira. You can check out the stories here. The thi...

246 views 1 18
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you