How could we retrieve all the values (master data) of status, severity and priority fields of IBM Rational Team Concert(RTC) using Java API?
2 answers
well, severity and priority are enumerations.. so you can get the list from
(See my sample code at post 3 of https://jazz.net/forum/questions/94776/assertionfailedexception-problem-with-getting-the-values-of-attributes)
List<ILiteral> enumerationLiterals = enumeration
.getEnumerationLiterals();
you have to get the states list from the WorkflowInfo object
here is some code from an advisor plugin
<code>
// get the worker objects
IAuditableCommon iac = ((ISaveParameter) data).getSaveOperationParameter().getAuditableCommon();
WorkflowManager wfm = new WorkflowManager(iac);
// reference the right object type (cast)
IWorkItem workItem = (IWorkItem) auditable;
// get the workflow this workitem is in, so we can get the labels of the states
IWorkflowInfo x =wfm.getWorkflowInfo(workItem, monitor);
if(Debug) System.out.println("the workitem state is "+ workItem.getState2().getStringIdentifier()+ "=" +x.getStateName(workItem.getState2()) );
// if this workitem is going into resolved state (we accessed 'proposed new' state above
if(x.getStateName(workItem.getState2()).equalsIgnoreCase(ResolvedState))
</code>
(See my sample code at post 3 of https://jazz.net/forum/questions/94776/assertionfailedexception-problem-with-getting-the-values-of-attributes)
List<ILiteral> enumerationLiterals = enumeration
.getEnumerationLiterals();
you have to get the states list from the WorkflowInfo object
here is some code from an advisor plugin
<code>
// get the worker objects
IAuditableCommon iac = ((ISaveParameter) data).getSaveOperationParameter().getAuditableCommon();
WorkflowManager wfm = new WorkflowManager(iac);
// reference the right object type (cast)
IWorkItem workItem = (IWorkItem) auditable;
// get the workflow this workitem is in, so we can get the labels of the states
IWorkflowInfo x =wfm.getWorkflowInfo(workItem, monitor);
if(Debug) System.out.println("the workitem state is "+ workItem.getState2().getStringIdentifier()+ "=" +x.getStateName(workItem.getState2()) );
// if this workitem is going into resolved state (we accessed 'proposed new' state above
if(x.getStateName(workItem.getState2()).equalsIgnoreCase(ResolvedState))
</code>