It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

How to add comments to existing Jira Service Desk Issues via API and preserve Comment Date and Time Edited

This concerns data migration from a different Ticket system into Jira Service Desk.

I am able to import issues into Jira Service desk and am able to create comments for these issues via API, however, I want to preserve the comment 'added' Date Time in the comment, Currently, Jira uses the current Date/Time and also uses the User ID that is being used to log in.  How can we control what goes in that 'created' field using the API?

1 answer

I don't think it can be done. The time a comment was added was the time it was added and the person who added the comment was the person who added it.

The REST API can only lookup those values, not alter them, the same as if you were using the web interface.

Ok, thanks, I found that using the 'JSON External System Import' in lieu of the API solves this particular problem. Now on to figuring out how to import the 'Organizations' field using JSON?  Has anybody tackled this yet?

Like David_Bakkers likes this

Thanks for the update. It's interesting that the JSON import method allows the author and created values to be set when the comment is being created, whereas the REST API doesn't.

The latest REST API docs say you can get and set the properties of a comment using the /rest/api/2/comment/{commentId}/properties/ endpoint. I just tried using that method to get all the properties of an existing comment, to know what I could set, but all that came back was an empty array called 'keys' with no sub-fields in it. That new REST API feature is marked as experimental, so maybe the functionality is yet to be properly implemented.

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Next-gen

Keyboard shortcuts have arrived for next-gen projects!

...ollected feedback from users around the lack of shortcuts, and we’re here to address that: In next-gen projects, I miss the keyboard shortcuts badly. This is particularly true on the Board, but also i...

236 views 2 4
Read article

Community Events

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

Find an event

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

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you