Is there a pre-condition to restrice only the owner can close the WI?
2 answers
You probably are interested in the functionality requested by work item Add special "owner" and "creator" roles, that specifies what the "owner" and "creator" respectively of an object can do to the object (88779) . If this is the kind of thing you had in mind, please feel free to add a comment to that work item indicating your interest/support.
Hi Jia,
quickly looking into the list of available preconditions, I can not spot one.
But it should be really easy to create Look up how to check a state change in the Extensions workshop. The code to check who does the state change should look similar to,
IWorkItem workItem = (IWorkItem) auditable;
IContributorHandle loggedIn = this.getAuthenticatedContributor();
IContributorHandle owner = workItem.getOwner();
if(!(owner!=null && owner.getItemId().equals(loggedIn.getItemId()))){
IAdvisorInfo info = collector.createProblemInfo("Fail", "The work item contained the string fail", "error");
collector.addInfo(info);
}
Assuming you extend AbstractService as you should.
quickly looking into the list of available preconditions, I can not spot one.
But it should be really easy to create Look up how to check a state change in the Extensions workshop. The code to check who does the state change should look similar to,
IWorkItem workItem = (IWorkItem) auditable;
IContributorHandle loggedIn = this.getAuthenticatedContributor();
IContributorHandle owner = workItem.getOwner();
if(!(owner!=null && owner.getItemId().equals(loggedIn.getItemId()))){
IAdvisorInfo info = collector.createProblemInfo("Fail", "The work item contained the string fail", "error");
collector.addInfo(info);
}
Assuming you extend AbstractService as you should.