It's all about the answers!

Ask a question

Can't see predecessor link in Query view when triggered through API in EWM.


Navjot Singh Bhatia (11) | asked Apr 20 '23, 8:11 a.m.

 Hello, 


Trying to link one work item to another through "predecessor" link type. and fetching it in query view as well

was using API:
linkManager.createLink(linkType, sourceRef, destRef);

linkManager is of type ILinkManager

Link is not getting created when the linkType is "com.ibm.team.workitem.linktype.schedulePredecessor" or "predecessor".

Also, when tried with "succesor" link type, the link to the Work Item was successfully created (both successor in one and predecessor in another) and when I was trying to get the link in the query view by adding the column "predecessor" it did not find in query view. 

Thankyou 
Navjot

One answer



permanent link
Ralph Schoon (63.3k33646) | answered Apr 20 '23, 9:09 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
edited Apr 20 '23, 9:13 a.m.

 
What do you think could someone take from your statement above? It is not even a question. The shared code is not existent. 

 
The work item command line, I believe, supports the creation of such links. See https://github.com/jazz-community/work-item-command-line  

You can look into com.ibm.js.team.workitem.commandline.helper.WorkItemUpdateHelper
* updateLinks(ParameterValue, List<Exception>)
* createReferences(String, ParameterValue, List<Exception>)

com.ibm.js.team.workitem.commandline.parameter.ParameterLinkIDMapper, com.ibm.js.team.workitem.commandline.utils.ReferenceUtil

I think I don't use the Linkmanager in the work item command line, but a different API on top of it. 

There are different types of references for different link types. The URL that needs to be used in the link creation is different. There are HTTP based URI's, there are itemLocations and namedLocations based URIs. This becomes obvious if you read existing links and print the URIs.

For the locations see 
https://rsjazz.wordpress.com/2012/09/19/the-rtc-workitem-link-api-linking-workitems-to-other-elements/

The link types above require work item based link types using the namedLocation, if I am not mistaken. Follow the examples and description in the blog. The work item links only work on one server, not across different servers.

If you use the wrong URI, the links will not work and you will have issues trying to delete them. In EWM work item links also require a back link to be created using an additional safe parameter. Again, I tried to explain that in my blog posts and the work item command line does it as well.

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.