Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

Pull-down variables access to "name" value

Hello guys,

as pull-down variables are composed of "name - value" pairs values, I would like to access in a project step, not only the value chosen but also the name it corresponds to.

I try to explain it better, I have defined an environment "pull-down" variable called "DESTENV" and defined some values as follows:

DES - Development
PRO - Production ...

In a project step if I refer to $DESTENV I get the value: "Development", "Production" ...

In this scenario, is there any way I can access the "name" value emulating the behaviour of a hash and its access to the key values?

Thanks!

Regards,

Jorge.

0 votes



2 answers

Permanent link
Hello guys,

as pull-down variables are composed of "name - value" pairs values, I would like to access in a project step, not only the value chosen but also the name it corresponds to.

I try to explain it better, I have defined an environment "pull-down" variable called "DESTENV" and defined some values as follows:

DES - Development
PRO - Production ...

In a project step if I refer to $DESTENV I get the value: "Development", "Production" ...

In this scenario, is there any way I can access the "name" value emulating the behaviour of a hash and its access to the key values?

Thanks!

Regards,

Jorge.


Hi Jorge,

I can't think of anything that will allow you to do exactly what you would like. You could use the Services Layer API to get at the information, but I think that may be a little more involved than what you are looking for. Have you considered using another environment variable pull-down that would be the reverse of the existing one.

Another option that you might consider is to use a Conditional step type to query the value of ${DESTENV} and set another variable based off that value. For example, the condition could be 'true(${DESTENV} eq Development)' and if that is true to set a variable DESTENV_DIR (.bset env "DESTENV_DIR=DEV"). You would need to do something similar for all of the possible values of DESTENV.

bju

0 votes


Permanent link
Hi Brent,

actually that were the workarounds I already thought of. The problems I see are:

1. Another pull-down variable: this is my current implementation. Problem is pull-down vbles always have a default value, which can lead to user to just pay attention to one of them.

2. Conditional step type: this approach can lead to have several dummies conditional steps (currently 3). Very ugly solution mostly if the pulldown values grow.

Anyway, thanks a lot for the tips. Don't hesitate to suggest any other possibilities you may think of :)

Regards,

Jorge.

0 votes

Your answer

Register or log in 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.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details

Question asked: Jun 03 '10, 4:42 p.m.

Question was seen: 6,061 times

Last updated: Jun 03 '10, 4:42 p.m.

Confirmation Cancel Confirm