It's all about the answers!

Ask a question

Can anyone please suggest on how to provide dates to the IWorkItem.RESOLUTION_DATE_PROPERTY in RTC Expressions


Shwetha G (60331) | asked May 12 '17, 12:47 a.m.
edited May 12 '17, 12:49 a.m.

Hello All,

We have to use Resolution date range in RTC Expressions using IWorkItem.RESOLUTION_DATE_PROPERTY.

We need to provide the start and end dates, AttributeOperation.BEFORE and AttributeOperation.AFTER.

Following is the code :
Expression resAfterDateExp = new AttributeExpression(resStartDateAttribute,AttributeOperation.AFTER,oldTimeStamp);
      Expression resBeforeDateExp= new AttributeExpression(resEndDateAttribute, AttributeOperation.BEFORE, currentTimeStamp);

however, we are not able to pass the values : oldTimeStamp and currentTimeStamp.

Please help us get this using sample examples if any.

Thanks


Accepted answer


permanent link
Shwetha G (60331) | answered May 12 '17, 1:44 a.m.

I used the following Timestamp code and it is working fine . :)

     Calendar calendar = Calendar.getInstance();
     java.sql.Timestamp currentTimestamp = new java.sql.Timestamp(calendar.getTime().getTime());
    
     java.sql.Timestamp oldTimeStamp = java.sql.Timestamp.valueOf("2017-05-01 10:10:10.0");

Ralph Schoon selected this answer as the correct answer

One other answer



permanent link
Ralph Schoon (63.6k33646) | answered May 12 '17, 3:29 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

This might work, but to get more control, you should be aware, that the product code uses SimpleDateFormat to convert timestamps into strings and strings back into timestamps.


The SimpleDateFormatUtil mentioned in https://rsjazz.wordpress.com/2013/01/02/working-with-work-item-attributes/ is available in the OpenSource Work Item Command Line. The OpenSource Work Item Command Line also has examples to access and convert all existing attribute types.

Your answer


Register or to post your answer.


Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.