button works only when job is running

51 views
Skip to first unread message

justine....@gmail.com

unread,
Nov 3, 2015, 5:29:32 AM11/3/15
to Jenkins Developers
I have problem with developing new plugin. I created class FirstPlugin with implements Action and added constructor:
public class FirstPlugin implements Action {
   private AbstractBuild build;
   public FirstPlugin(AbstractBuild build) {
      this.build = build;
   }
...
}

then, in summay.jelly i created button and connected it with a function in my java class. It seems to work but only if the job is running. When build is terminated and I click the button nothing happens. I guess my constructor can be wrong but I need access to build class and build summary screen.

justine....@gmail.com

unread,
Nov 3, 2015, 7:04:58 AM11/3/15
to Jenkins Developers
I just realized, that if I add this button to action.jelly it works good, but I dont have access to it object - I need it to determine whether button appears or not, depending on job type.

Vincent Latombe

unread,
Nov 3, 2015, 7:19:40 AM11/3/15
to Jenkins Dev
Hi Justine,

depending on what you want to do exactly, http://javadoc.jenkins-ci.org/?jenkins/model/TransientActionFactory.html could help.

Vincent

2015-11-03 13:04 GMT+01:00 <justine....@gmail.com>:
I just realized, that if I add this button to action.jelly it works good, but I dont have access to it object - I need it to determine whether button appears or not, depending on job type.

--
You received this message because you are subscribed to the Google Groups "Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-de...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/247253c6-ea5a-4930-ab4e-06007b0ca62a%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages