It's all about the answers!

Ask a question

Is there a pre-condition to restrice only the owner can close the WI?


Jia Jia Li (8058157192) | asked Nov 05 '12, 2:10 a.m.
edited Nov 05 '12, 2:39 a.m. by Ralph Schoon (63.5k33646)
Hi, 
For the WorkItem, we want to set only the owner can close the WI. Is there exist pre-condition for it?
Thanks very much!

2 answers



permanent link
Ralph Schoon (63.5k33646) | answered Nov 05 '12, 2:39 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
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.

permanent link
Geoffrey Clemm (30.1k33035) | answered Nov 05 '12, 3:51 p.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
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.

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.