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

RTC: how to make mandatory the "Duplicate Of" link?

I need to enable this behavior in RTC (version 4.0.6):
  • when a work item is closed with the action Duplicate (and the resolution Duplicate), the Duplicated Of link must be mandatory, and the work item save must fail if such a link is not provided
I know that this is an out-of-the-box behavior in RTC, and I have seen it working in the past, but now I have made some changes to the project area (to the workflows and to the presentations), and it doesn't work any more, allowing users to close a record as a duplicate without linking it to another.
Can this feature be re-activated?

1

0 votes


Accepted answer

Permanent link
Luca, since the validation is still hard-coded I found that changing the state id to that of the original workflow forces the check to happen ("r2" if I remember correctly).
Luca Martinucci selected this answer as the correct answer

1 vote

Comments

Luis, are you saying that I should change the state id of the "Closed" state to "r2"? (it currently "s5" in the bugzilla workflow I am using for Defects).
Also, is there any way to enable this behavior for the other workflows (so that I can enable it for Change Requests, Tasks, ...)?

I meant to say the resolution id. "r2" is the resolution id for state Closed - Duplicate.

 It seems there is a previous check too, the workflowid must match the defect workflow id or "bugzillaWorkflow"

About enabling this in other item types, they would need the same workflowDefeinition id, so only "bugzillaWorkflow" or the same id of the defect type.


2 other answers

Permanent link
We have never been able to get this to work for anything that we have customized and therefore, have written a custom Validator to check for this.

0 votes

Comments

Hi there - can you share what that validator looks like? Script or ?

Our resolution for duplicate all end with ".duplicate" in our configuration, so the validator does this:
if (wi.getResolution2().getStringIdentifier().endsWith(".duplicate")) {
  if (!hasDuplicateOfLink(saveParameter.getNewReferences())) {
     IAdvisorInfo createProblemInfo = collector.createProblemInfo("DuplicateOf Link Required", "To mark the work item as Duplicate, you must have a DuplicateOf link.","error");
     collector.addInfo(createProblemInfo);
     return;
  }
  return;
}

And the hasDuplicateOfLink method is:
private boolean hasDuplicateOfLink(IWorkItemReferences references) throws TeamRepositoryException {
    List<IReference> duplicateOfLinks = references.getReferences(WorkItemEndPoints.DUPLICATE_OF_WORK_ITEM);

    if (duplicateOfLinks == null) return false;
    if (duplicateOfLinks.size() < 1) return false;

    return true;
}

1 vote


Permanent link
the check for this is hard coded to the IBM workitem type ID.

I opened enhancement 242467 to move this function to an external function


0 votes

Comments

Sam, are you saying that this behavior is "inherent" to a workitem type?
So, I wonder how it could suddenly "disappear" from that workitem type.
According to this enhancement request https://jazz.net/jazz/web/projects/Rational%20Team%20Concert#action=com.ibm.team.workitem.viewWorkItem&id=237971 , it is hard-coded in these workflows: EclipseWayWorkflow.ID and InternalWorkflowKeys.DEFECT_WORKFLOW_ID.
Anyway, I have a project area where Defects, which use the Default Workflow (id: bugzillaWorkflow) have this desired behavior on Duplicate.
In another project area (on a different RTC server, but with the same RTC version), Defects using the same workflow do not have this behavior.

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
× 12,098

Question asked: Jan 20 '15, 11:22 a.m.

Question was seen: 5,721 times

Last updated: Mar 09 '15, 1:26 p.m.

Confirmation Cancel Confirm