It's all about the answers!

Ask a question

How to make a plugin applicable only to a particular workitem


mohan kumar (78220) | asked Jun 29 '15, 1:25 a.m.
Hi all,

I have created an plugin which checks if workitem has a parent WorkItem link or not.
If parent workitem is not Linked, you can't save child workitem. Now I want this plugin
to applicable for a particular workitem not all the workitem in the project.

Regards,
Mohan

Accepted answer


permanent link
Ralph Schoon (55.9k23642) | answered Jun 29 '15, 2:39 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
In an advisor, the advisor has to check, weather it needs to run or not. Your advisor would look at information for example the type of the work item to determine if it needs to run. You can make the extension configurable. See Rational Team Concert Extensions Workshop how this is done.
mohan kumar selected this answer as the correct answer

Comments
mohan kumar commented Jun 29 '15, 3:14 a.m.

Hi Ralph,
Thanks for reply I have already deployed that plugin successfully and added the plugin to Preconditions( Team Configuration -> Operation Behavior, look for Work Items -> Save Work Item (server) and click Add to add our Advisor) but plugin is applicable to all workitem but i need this plugin to work for only one particular workitem .


Ralph Schoon commented Jun 29 '15, 3:19 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

Again, your plugin has to look at the data that triggers it and decide if it needs to run as explained in the Rational Team Concert Extensions Workshop Lab 3,4. The extension there looks at the work item type and only works for the type it is configured for. It also looks at the work item state and only works if the state it the one it is configured to react on.


sam detweiler commented Jun 29 '15, 7:25 a.m.

As Ralph said., YOU have to write code in your plugin, and exit quietly if the type of  the workitem that triggered the plugin is not the one you care about.

Your answer


Register or to post your answer.