0
how to update status of all items in a project like from open status to worked status.
In forum i got how to retrieve all items with open status from a project.
how to update staus using java api

Filter filter = new Filter();
filter.criteria().add(new Filter.Criterion(SystemAttributes.STATUS, "OPEN", Filter.Criterion.EQUALS));
filter.criteria().add(new Filter.Criterion(SystemAttributes.IS_LATEST_REV, "true", Filter.Criterion.EQUALS));
List itemList = gProject.getChildItems(filter);

Accepted Answer

Thursday, June 29 2017, 02:07 AM - #Permalink
1
Hi Srikanth,

Use the below code to update the status of the items.


public static void actionItems(List itemList)
{
DimensionsRelatedObject relObj=null;
ItemRevision itr=null;
final int[] itemAttrNums = new int[] {};
try{
for(Object obj :itemList )
{

relObj=(DimensionsRelatedObject) obj;
itr=(ItemRevision) relObj.getObject();
itr.actionTo("REVIEWED", itemAttrNums);
}

}
catch(Exception e)
{
e.printStackTrace();
}
}


Thanks
Esh
  • srikanth chikoti
    more than a month ago
    thanks a lot for reply. it is not working. will empty itemAttrNums work ? i tried with
    SystemAttributes.STATUS it thrown exception saying system attr are not allowed

Location [ View Larger Map ]

The reply is currently minimized Show
Responses (2)
  • Accepted Answer

    Thursday, June 29 2017, 03:36 PM - #Permalink
    0
    thanks a lot for reply. it is not working. will empty itemAttrNums work ? i tried with
    SystemAttributes.STATUS it thrown exception saying system attr are not allowed
    The reply is currently minimized Show
  • Accepted Answer

    Thursday, June 29 2017, 04:00 PM - #Permalink
    0
    sorry. It worked. I dont know why it is not reflected in UI. I just closed dimension session and re-opened. Then it showed me updated status.
    You saved me.
    The reply is currently minimized Show
Your Reply