How to programmatically add Related Change Request link?
I have created an operation Advisor that is communicating with an external system using OSLC interface. Now I need to save a link to the other system.
Is there any way to programmatically add a Related Change Request link to the workitem? I am using RTC 2.0.02 iFix 5. |
6 answers
Hi,
Please look at https://jazz.net/wiki/bin/view/Main/ProgrammaticLinkCreation Does that answer your question? Rgs, /N |
Hi, No, all examples in the document references to code on client side. I need to be able create a link to the workitem in the save operation for the Operation Advisor on the server side. |
No, all examples in the document references to code on client side. I need to be able create a link to the workitem in the save operation for the Operation Advisor on the server side. OK -- might not be the best way, but code below is working (tried using RTC 3) .. and some lessons learned. 1. See https://jazz.net/wiki/bin/view/Main/RTCSDK20_ProcessPreConditionExample and the example https://jazz.net/wiki/pub/Main/RTCSDK20_ProcessPreConditionExample/advisor-example.zip 2. To get access to services for creating items etc - make your handler a subclass to the AbstractService. And to get access to services in the advisor you must ask for them as preconditions. See example below <plugin> 3. And a code snippet with an advisor that creates a Parent & and link to the new parent each time the item is saved (note: needs to turn off the FiledAgainst precondition for SaveItem to have this work)
|
Follow up question from celin:
=== Now I had time to test your example and got it to work, but unfortunately it does not address the problem I have, I want to add a Change Management link to the current workitem. I have not found how to create a IEndPointDescriptor of the type that the reference to MHWeb becomes, to use the code below. I have resolved the references and see that id = "relatedChangeManagement" for this type EndPointDecsriptor when we sent the link to the RTC from Mhweb by passing the tag <oslc_cm> references.add(WorkItemEndPoints.PARENT_WORK_ITEM, WorkItemLinkTypes.createWorkItemReference(source)); === So -- how to find the way of programmatically create a link of Change Management linktype? /N |
Something like this may work, where you create a link of WorkItemLinkeTypes.RELATED_CHANGE_MANAGEMENT
|
For advisors, the solutions above don't work to add link to current work item.
What you have to do in this case is only that:
You don't need to save anything to edit the current work item because you are already in a save operation. |
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.