Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How to set the create date on imported issues

daniel frentz
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
April 10, 2016

Hello,

 

I'm currently writing a migration script to import tickets from our ticketing system into JIRA service desk. I am using the REST API to interact with JIRA. I can create calls, but how can I set the create date?

 

Thanks.

2 answers

0 votes
daniel frentz
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
April 11, 2016

Thank Aleks,

 

I forgot to mention that I am using the REST API.

 

 

0 votes
Aleks Yenin (Polontech)
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.
April 11, 2016

Hello Daniel,
 
Try this script: 

import java.util.Date;

import java.util.Calendar;

import java.sql.Timestamp;

Date date= createdDate;
Calendar cal = Calendar.getInstance();
cal.setTime(date);
long millis = cal.getTimeInMillis();

Timestamp ts = new Timestamp(millis)

mutableIssue.setCreated(ts);

Suggest an answer

Log in or Sign up to answer