Skip to content

Conversation

@taxaos
Copy link

@taxaos taxaos commented Dec 19, 2019

Hello,

it is not secured, that the parameters are in $actions[0]. So you have to iterate over all actions and find the parameters.

In my case, the code looked like this

Array
(
    [0] => stdClass Object
        (
            [_class] => hudson.model.CauseAction
        )

    [1] => stdClass Object
        (
            [_class] => hudson.model.ParametersAction
            [parameters] => Array
                (
                    [0] => stdClass Object
                        (
                            [_class] => hudson.model.StringParameterValue
                            [name] => BRANCH
                            [value] => master
                        )

                    [1] => stdClass Object
                        (
                            [_class] => hudson.model.StringParameterValue
                            [name] => SERVER
                            [value] => prod
                        )

                )

        )

    [2] => stdClass Object
        (
        )

    [3] => stdClass Object
        (
        )

    [4] => stdClass Object
        (
            [_class] => hudson.plugins.git.util.BuildData
        )

    [5] => stdClass Object
        (
            [_class] => hudson.plugins.git.GitTagAction
        )

    [6] => stdClass Object
        (
        )

    [7] => stdClass Object
        (
        )

    [8] => stdClass Object
        (
        )

    [9] => stdClass Object
        (
        )

    [10] => stdClass Object
        (
        )

    [11] => stdClass Object
        (
        )

    [12] => stdClass Object
        (
            [_class] => org.jenkinsci.plugins.pipeline.modeldefinition.actions.RestartDeclarativePipelineAction
        )

    [13] => stdClass Object
        (
        )

    [14] => stdClass Object
        (
            [_class] => org.jenkinsci.plugins.workflow.job.views.FlowGraphAction
        )

    [15] => stdClass Object
        (
        )

    [16] => stdClass Object
        (
        )

    [17] => stdClass Object
        (
        )

)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants