Is there a way to fetch "relate time" - when an attachment is related to work-item using java api?
I am working on a synchronizer tool which migrates and synchronizes the objects between 2 different applications. There is a need to synchronize the attachments between the applications as well.
I have to fetch the list of attachments for a given work-item and also fetch the date-time when it actually got related to the work-item. There is an option to fetch the create_time of the attachment, but that time is when the attachment is created/uploaded. After the attachment is uploaded, you have to save the work-item. So there is a chance for uploading the attachments and after couple of minutes saving the work-item. This use-case creates problem in my tool as I am using the create_time to make some decisions. Misunderstood that the create_time is going to be the same as relate_time.
So I would like to know whether there is a way to get the relate_time for an attachment using plain java-api.
Any kind of input is highly appreciated. Thanks.
I have to fetch the list of attachments for a given work-item and also fetch the date-time when it actually got related to the work-item. There is an option to fetch the create_time of the attachment, but that time is when the attachment is created/uploaded. After the attachment is uploaded, you have to save the work-item. So there is a chance for uploading the attachments and after couple of minutes saving the work-item. This use-case creates problem in my tool as I am using the create_time to make some decisions. Misunderstood that the create_time is going to be the same as relate_time.
So I would like to know whether there is a way to get the relate_time for an attachment using plain java-api.
Any kind of input is highly appreciated. Thanks.
One answer
The API only exposes CREATION_DATE_PROPERTY with getCreationDate(). The AttachmentImpl internal class, also does not expose any other data as far as I can see. So you would have to work with the creationDate - it is in milliseconds, that should be accurate enough, I think.