It's all about the answers!

Ask a question

Is there a way to add a customized action to a BuildDefiniton action list


Steve White (4021213) | asked Sep 15 '14, 9:58 a.m.
When a user right clicks on a BuildDefintion I want to add a action to that list that will cause some custom code to run against that builddefinition. Specifically I want to load the build definition with predefinied properties for a properties file instead of having the user manually type in all the properties. I want to use the existing build definitions and do not want to create a custom template because our build implementation supports multiple types of build definitions that exist.
Currently I have a custom delete action on the build result, so hoping I can also extend the build definition action list.

2 answers



permanent link
Ernest Crvich (19211919) | answered Sep 17 '14, 2:29 p.m.
Doesn't appear the copy/paste option works/exists, at least in the 4.0.2 Eclipse client.  I go into the Properties tab of a build definition, use Edit->Select All, but the Edit->Copy/Cut/Paste options remain grayed out, and Ctrl-C doesn't affect the clipboard (as evidenced by pasting into a text file, which just pastes what I previously had in the clipboard.  Is the copy/paste option only offered in later versions of RTC?

Comments
Heather Fraser-Dube commented Sep 17 '14, 2:44 p.m.
JAZZ DEVELOPER

The feature was put into 4.0.5 Eclipse client


permanent link
Nick Edgar (6.5k711) | answered Sep 15 '14, 10:24 a.m.
JAZZ DEVELOPER
Hi Steve, there's a bit of an easter egg feature whereby if you hold down Ctrl while choosing Edit Configuration (in the header menu in the build definition editor), it shows all available config options, not just those listed by the definition's template. So you could just define a buildConfigurationElements extension, assuming the defaults for the properties are statically defined. If that's not the case, the class to target for an object action contribution is com.ibm.team.build.internal.ui.domain.BuildDefinitionQueryNode. See how this is targeted in the plugin.xml for com.ibm.team.build.ui for the Show History action.

Comments
Steve White commented Sep 15 '14, 11:15 a.m.

Nick thanks for the quick reply.
I have used the  buildConfigurationElements extension in the past in tangent with a custom BuildDef Template. But we discarded that solution. Our current solution does not require a custom Build Def and will run on any BuildDef/Engine that supports ANT.
I thought the buildConfigurationElements had to be used/defined by a template


Steve White commented Sep 15 '14, 11:16 a.m.

So let me clarify further. We have many properties that need to be manually entered in the Build Def. We would like to avoid having the user type them all in. Additionally some properties are common while others are propriety depending on the build type the user may run. So one thought was to provide a properties file(there may be several based on build type) that a user could import into any build def a set them into the properties tab on the build def. Are thinking is we could programmatically do that if we could add an action to the build def pulldown i.e. import  properties...
So it appears using the object action contribution is com.ibm.team.build.internal.ui.domain.BuildDefinitionQueryNode would allow us to do this? unless you have any other suggestions?


Heather Fraser-Dube commented Sep 15 '14, 11:41 a.m.
JAZZ DEVELOPER

The properties section of build definitions/engines supports copy and paste. If you copy the selected properties with Ctl-c and then paste into a normal file (as opposed to another build defn), they will be pasted in xml format. You can then edit the xml to change the properties as desired and then select all the xml copy with ctl-c and then turn around and paste (ctl-v) back into the properties section of a defn. Not as smooth as you want, but just wanted to let you know about copy/paste.


Nick Edgar commented Sep 16 '14, 8:58 a.m.
JAZZ DEVELOPER

Steve, I suggest trying Heather's suggestion of using copy/paste. If that doesn't work for you, we can circle back and discuss APIs further.

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.