How to read parameters in Work-Flow plugin

98 views
Skip to first unread message

Rupali

unread,
Nov 20, 2014, 9:05:09 AM11/20/14
to jenkins...@googlegroups.com
Hi,

I am trying beta version of new work-flow plugin.
https://github.com/jenkinsci/workflow-plugin

I tried some basic steps to run multiple steps one after other in a workflow using Groovy CPS DSL which are working fine.
But I am unable to read job parameters in in the workflow or parameters selected as part of one step into another step of same workflow.
Can you advise how to do that?

Regards,
Rupali

Rupali

unread,
Nov 24, 2014, 10:10:58 AM11/24/14
to jenkins...@googlegroups.com
Resending with Subject changed and mrore details on the request.

I have below input step:
input id: '4a894d73cf15795f912d3ce0f2f54c51', message: 'DEPLOY Parameters', ok: 'Proceed', parameters: [[$class: 'StringParameterDefinition', defaultValue: 'SC', description: '', name: 'projName'], [$class: 'TextParameterDefinition', defaultValue: '1234', description: '', name: 'projID']]

How do I read values of the parameters projName and projID in my next steps in work-flow?

Regards,
Rupali

Kohsuke Kawaguchi

unread,
Nov 25, 2014, 2:45:24 PM11/25/14
to jenkins...@googlegroups.com
Right, this needs to be documented better (and Jesse is working on it.)

The input step returns a map that contains the values as a Map. So in your case

v = input(...)
echo(v.projName)
echo(v.projID)

In your case those are both string parameters, so you get a java.lang.String object. Some other parameters return a different value, such as a boolean for a checkbox parameter.

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/6c24c0e1-1147-4058-987c-4436fa716296%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Kohsuke Kawaguchi

Rupali Chorghe

unread,
Nov 25, 2014, 9:34:49 PM11/25/14
to jenkins...@googlegroups.com

Great. Thanks for the explanation.

Regards,
Rupali

You received this message because you are subscribed to a topic in the Google Groups "Jenkins Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/jenkinsci-users/jHcBiXSXDzE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to jenkinsci-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/CAN4CQ4yut2tKXSoKcT0uWXs38jsD8%3Dnv5geS_WkBfD%2B1FfcEQg%40mail.gmail.com.
Reply all
Reply to author
Forward
0 new messages