Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

Is it possible to check Related -> Type in Java API?

 I am trying to build the following filter (Query building) using Plain Java API 

Type: Defect AND Related (Link) -> Type is: Task AND Defect Status is UnResolved

I am able to do this in Web client. Just that I am not sure how to get the "Related" link's type using API

Edit: I need to build the below using Expressions in Plain Java API. Is this possible?
Query filters

1

0 votes

Comments

Have you looked at this blog post from Ralph about working with the Work Item Linking API?

Yes, but I am looking for how to build  "Related" Links in query filter using Plain Java API 





 anyone?

Is this possible at all using API's?  Reason is I cannot achieve this using Eclipse client where as it's possible using web client 

Hello Ralph Schoon  


Would you be able to be help me here?

I would suggest - like Millard - to start with my blog. Start here: https://rsjazz.wordpress.com/2013/02/28/setting-up-rational-team-concert-for-api-development/

The blog contains articles about server and client link API's and also how to programmatic create and use queries, if you want that. If you can do it with the WebUI normal query mechanism you could do it using the API. See: http://rsjazz.wordpress.com/2012/10/29/using-work-item-queris-for-automation/

If the Eclipse and the Web UI behave differently, this is a defect you should report.

Dependant on what you want to do, you can do more with the API e.g. investigate the data in work items, look at links etc. See for example https://rsjazz.wordpress.com/2012/09/19/the-rtc-workitem-link-api-linking-workitems-to-other-elements/ or https://rsjazz.wordpress.com/2012/09/20/the-rtc-workitem-server-link-api-linking-to-work-items-and-other-elements/

1 vote

showing 5 of 6 show 1 more comments


One answer

Permanent link

Hello ,

I am not sure about the API type(Server side or client side.). I am providing you for client side API to get Related artifact. If you want server side as well let me know.

List<IReference> relatedRefs = workItemClient.resolveWorkItemReferences(
    retrofitWI, null).getReferences(WorkItemEndPoints.RELATED_WORK_ITEM);
  for (IReference relatedRef : relatedRefs) {
   if (relatedRef.resolve() instanceof IWorkItemHandle){
    IWorkItem relatedWI= auditableClient.resolveAuditable((IWorkItemHandle) relatedRef.resolve(),IWorkItem.FULL_PROFILE, null);

String stateName = WorkflowUtilities.findWorkflowInfo(
        relatedWI, null).getStateName(relatedWI.getState2());
       System.out.println("Type  "+relatedWI.getWorkItemType());

       System.out.println("State Name  "+stateName);

}

}

1 vote

Comments

Thanks for this but I want to have this in the Filter condition of  a query. I've edited my post with a screenshot. Please check that 

Your answer

Register or log in 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.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 10,943
× 411

Question asked: May 14 '13, 7:04 a.m.

Question was seen: 6,160 times

Last updated: May 23 '13, 11:18 a.m.

Confirmation Cancel Confirm