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

IBM RTC 6.0.2 Is there any way to enforce a link type to make it mandatory?

 Hello, 
I would like to have a work item type to be enforced to have a link during the promotion of the work flow, I didn't notice any parameter easy to configure in enclipse is there any scripted way to do it?
I want to make mandatory or require a link type when the user attempt to promote the WI  to the next state, I don't see how to handle the behavior of the links types. 

1

0 votes



2 answers

Permanent link
It's has been asked quite a few times before. You need to write a server side extension for it.
https://jazz.net/forum/questions/224732/mandatory-to-link-work-item
https://jazz.net/forum/questions/216569/mandatory-duplicate-work-item-link-if-duplicate-resolution-is-selected
https://jazz.net/forum/questions/172149/rtc-how-to-make-mandatory-the-duplicate-of-link
https://jazz.net/forum/questions/213375/how-to-set-links-as-mandatory-before-saving-a-workitem

0 votes


Permanent link
I had  the same need, and I had to develop a custom java extension (a participant) to enforce this behaviour.
I hope that these code snippets help you:

// get list of links of the work item
Object data = operation.getOperationData();
ISaveParameter saveParameter = null;
if (data instanceof ISaveParameter) {
    saveParameter = (ISaveParameter) data;
 }
IWorkItemReferences refs = saveParameter.getNewReferences();
// check if the "parent" link is present
IEndPointDescriptor mandatoryLinkDesc = WorkItemEndPoints.PARENT_WORK_ITEM;
// get list of links of the work item
List<IReference> listReferences = refs.getReferences(mandatoryLinkDesc);        
if ((listReferences!=null) && (!listReferences.isEmpty())) {
    // mandatory link present
} else {
    // mandatory link not present
    // TODO
    // return an error
} 


0 votes

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
× 6,131

Question asked: Nov 30 '16, 2:09 p.m.

Question was seen: 1,733 times

Last updated: Dec 01 '16, 5:44 a.m.

Confirmation Cancel Confirm