It's all about the answers!

Ask a question

How can I access attributes of a "Contributes To" work item across CCM repositories in a Follow-up Action?


Kirk Woods (5157) | asked Jul 14 '15, 1:12 p.m.
My question is:  Given that the user has permission across all project areas involved, is it possible to access a work item residing in a different repository from a follow up action that is using the Tracks/Contributes To link?
Phrased differently:
The "tracks" link has the URI of the work item, so if Work Item 1 (on server ccm1) tracks Work Item 2 (on server ccm2) can a follow-up action on ccm1 access the attribute of Work Item 2 on ccm2?  If so, how can it be done, or is it a bad practice to have one server make a request to another server?  Also, do all the ccm servers have to use the same JTS server, or can this work across JTS server environments?

The function I am trying to achieve is to have a custom attribute which contains the rolled up story points into a tracking work item for monitoring progress.  Basically like the current parent child relationship, but this has to cross multiple ccm servers, so I have to use the Tracks/Contributes To link.

3 answers



permanent link
Abraham Sweiss (2.4k1031) | answered Jul 14 '15, 4:41 p.m.
A custom plugin will need to be created.  Reason being is that artifacts in a workitem will only be able to access other artifacts in that same workitem.

Comments
Kirk Woods commented Jul 14 '15, 5:40 p.m.

The follow-up action is a custom plugin.  The question is how does one communicate between CCM servers in the follow-up action.  Within a single server, one can access all the work items, but in a multi-server environment (where the servers are "friends") all one has is the URI of the other work item, so is there a way with the URI to request the attributes of the work item from the other server?


permanent link
Abraham Sweiss (2.4k1031) | answered Jul 15 '15, 9:27 a.m.
The following forum post describes how to use the REST api to list the attributes in a workitem.
https://jazz.net/forum/questions/172284/how-to-read-the-values-of-custom-workitem-attributes-using-rest


permanent link
Ralph Schoon (57.1k23642) | answered Jul 15 '15, 9:36 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
Kirk, "Contributes To" is not an attribute, but a link. See https://rsjazz.wordpress.com/2012/09/20/the-rtc-workitem-server-link-api-linking-to-work-items-and-other-elements/  and https://rsjazz.wordpress.com/2012/10/20/following-calm-links-using-the-java-client-or-server-api/

I have not tried to cross the border between two CLM and I don't know how that would work yet.

Comments
Kirk Woods commented Jul 15 '15, 10:03 a.m. | edited Jul 15 '15, 10:05 a.m.

In the code, the link is "tracked by" on one side and "tracks" on the other.  Within the same repository one would just use IWorkItemServer:

workItemServer.getAuditableServer().resolveHandleFromLocation(Location.location(uri));

So what mechanism is used to get the other ccm server's WorkItemServer or AuditableServer to get the handle from the uri and then use its AuditbleCommon to resolve the handle to get the actual work item.


Ralph Schoon commented Jul 15 '15, 10:07 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

As I said, I don't know if the API will automatically log in to the other server. I haven't tried that yet.

You would have to try. The location(s) contain the public URI of the different CCM's. If the CCM's are friends or registered to the same JTS, the backing code might do it for you. Otherwise this would be a problem, since you can't get at the credentials of the user to log into the remote server.

Your answer


Register or to post your answer.