Active Choices Reactive Parameter

18 views
Skip to first unread message

Tomáš Pavelka

unread,
Dec 5, 2017, 6:33:28 AM12/5/17
to BioUno Users
Hello,
i'm developing jenkins job which use Active Choices Reactive Parameter.  Is possible set into groovy variable in parameter script the name of curent parameter?

Thanks

Tomas

Ioannis Moutsatsos

unread,
Dec 7, 2017, 1:20:38 PM12/7/17
to BioUno Users
Tomas I do not understand your question. Are you asking if you can have a self-referencing Active Choice parameter?
In other words if your parameter is AC_PA then referenncing AC_PA?

Otherwise, you need to pass another form parameter in as a Referenced parameter

Tomáš Pavelka

unread,
Dec 8, 2017, 3:07:30 AM12/8/17
to biouno...@googlegroups.com
Hi,
i need name of whole parameter in groovy script. More information in screenshot bellow.

Vložený obrázek 1

Thanks

Tomas

--
You received this message because you are subscribed to a topic in the Google Groups "BioUno Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/biouno-users/CbRwx6ZhKmM/unsubscribe.
To unsubscribe from this group and all its topics, send an email to biouno-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Bruno P. Kinoshita

unread,
Dec 8, 2017, 4:21:06 AM12/8/17
to biouno...@googlegroups.com
Hi Tomas!

I saw your first message some days ago and moved from one of the folders in my e-mail reader to my inbox. I was sure I could reply within a few hours... but then I realized it would be probably impossible with the current code...

Had some time today, and confirmed that it's not doable. The reason is that the object evaluating your groovy code (or the `this`, which you can use in your script) is a Script object. The actual Parameter (actually some child class from ParameterDefinition) is never passed to the Script. So it has no way of knowing which parameter you have. The only relation between the parameter and the script, is the actual groovy code you passed, and some environment variables.


So I created https://issues.jenkins-ci.org/browse/JENKINS-48448, and pushed a fix with a unit test. I'm also attaching a .hpi file. Would be great if you/Ioannis could give it a go and see if that works.

The parameter will be bound to the jenkinsParameter variable. And you can retrieve its name through the jenkinsParameter.getName() call.


Attached some screen shots to the ticket. Take a look if that's helpful too.

Quite interesting that only now someone wanted to use the actual parameter name. Through that jenkinsParameter you should be able to also get which kind of parameter you have. Not sure if that'll be helpful to you, but maybe to someone else.


Thanks for reporting your issue.


Cheers
Bruno


________________________________
From: Tomáš Pavelka <to...@tomaspavelka.eu>
To: biouno...@googlegroups.com
Sent: Friday, 8 December 2017 9:07 PM
Subject: Re: Active Choices Reactive Parameter



Hi,
i need name of whole parameter in groovy script. More information in screenshot bellow.



Thanks

Tomas



2017-12-07 19:20 GMT+01:00 Ioannis Moutsatsos <imout...@gmail.com>:

Tomas I do not understand your question. Are you asking if you can have a self-referencing Active Choice parameter?
>In other words if your parameter is AC_PA then referenncing AC_PA?
>
>
>Otherwise, you need to pass another form parameter in as a Referenced parameter
>
>On Tuesday, December 5, 2017 at 6:33:28 AM UTC-5, Tomáš Pavelka wrote:
>Hello,
>>i'm developing jenkins job which use Active Choices Reactive Parameter. Is possible set into groovy variable in parameter script the name of curent parameter?
>>
>>Thanks
>>
>>Tomas
>>
--
>You received this message because you are subscribed to a topic in the Google Groups "BioUno Users" group.
>To unsubscribe from this topic, visit https://groups.google.com/d/ topic/biouno-users/ CbRwx6ZhKmM/unsubscribe.
>To unsubscribe from this group and all its topics, send an email to biouno-users+unsubscribe@ googlegroups.com.
>For more options, visit https://groups.google.com/d/ optout.
>
>


--
You received this message because you are subscribed to the Google Groups "BioUno Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to biouno-users...@googlegroups.com.

Tomáš Pavelka

unread,
Dec 8, 2017, 4:43:20 AM12/8/17
to biouno...@googlegroups.com
Hi Bruno!,

it looks fine. Works perferct.

Thanks a lot !

Tomas

To unsubscribe from this group and stop receiving emails from it, send an email to biouno-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to a topic in the Google Groups "BioUno Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/biouno-users/CbRwx6ZhKmM/unsubscribe.
To unsubscribe from this group and all its topics, send an email to biouno-users+unsubscribe@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages