Fetch Last state time

Discuss problems installing or using TrackStudio.

Fetch Last state time

Postby skd » Wed Apr 01, 2015 4:34 pm

In one task have multiple "RESOLVE" state How can i get last "RESOLVE" state time?

By following code: i get only first "Resolve" state time

for(SecuredMessageBean message:task.getMessages()) {
if (message.getMstatus().getName().equals(" Acknowledge"))
assigndate = message.getTime();
if (message.getMstatus().getName().equals(" Resolve"))
resolvedate = message.getTime();
}

Thanks in advance
skd
 
Posts: 9
Joined: Fri Feb 27, 2015 9:54 am

Re: Fetch Last state time

Postby dpochtarev » Thu Apr 02, 2015 4:51 pm

Code: Select all
for(SecuredMessageBean message:task.getMessages()) {
            if ("Acknowledge".equals(message.getMstatus().getName()))
                assigndate = message.getTime();
            if ("Resolve".equals(message.getMstatus().getName()))  {
                if(resolvedate!=null && message.getTime().getTimeInMillis() > resolvedate.getTimeInMillis())
                    resolvedate = message.getTime();
                else
                    resolvedate = message.getTime();
            }
        }
dpochtarev
 
Posts: 256
Joined: Wed Aug 22, 2012 4:35 pm


Return to TrackStudio Support

Who is online

Users browsing this forum: No registered users and 3 guests