Updating Jira tickets from Jenkins workflow (jenkinsfile)

后端 未结 3 520
猫巷女王i
猫巷女王i 2021-01-03 06:02

How can I update a jira issue from within a Jenkinsfile (jenkins-worflow/pipeline)? Is there a way I could use the Jira Issue Updater plugin as a step in the Jenkinsfile?

3条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-01-03 06:42

    The Jira Plugin is compatible with Pipeline.

    This should work:

    step([$class: 'hudson.plugins.jira.JiraIssueUpdater', 
        issueSelector: [$class: 'hudson.plugins.jira.selector.DefaultIssueSelector'], 
        scm: [$class: 'GitSCM', branches: [[name: '*/master']], 
            userRemoteConfigs: [[url: 'https://github.com/jglick/simple-maven-project-with-tests.git']]]]) 
    

    You can get a full reference in the built-in Pipeline Snippet Generator.

提交回复
热议问题