Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JiraVersionParameter in pipelines #609

Open
topicus-pw-dvdouden opened this issue Jul 25, 2024 · 0 comments
Open

JiraVersionParameter in pipelines #609

topicus-pw-dvdouden opened this issue Jul 25, 2024 · 0 comments

Comments

@topicus-pw-dvdouden
Copy link

What feature do you want to see added?

We can currently only use the JiraVersionParameter in non-pipeline jobs. It would be nice to also be able to use them in pipeline jobs so we can migrate old freestyle jobs to new pipeline jobs.

Just adding the @Symbol annotation to the JiraVersionParameterDefinition.DescriptorImpl class seems to do the trick.

@Symbol( "jiraReleaseVersion" )
@Extension
public static class DescriptorImpl extends ParameterDescriptor {
    @Override
    public String getDisplayName() {
        return "Jira Release Version Parameter";
    }
}

This would allow for a pipeline job like:

pipeline {
    agent any

    parameters {
        jiraReleaseVersion description: 'Version', jiraProjectKey: 'PK', jiraReleasePattern: '[0-9]{2}\\.[0-9]{2}\\.00\\.00', jiraShowArchived: 'true', jiraShowReleased: 'true', name: 'VERSION'
    }

    stages {
        stage('Print Version') {
            steps {
                echo VERSION
            }
        }
    }
}

Upstream changes

No response

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

No branches or pull requests

1 participant