Updating Jira tickets from Jenkins workflow (jenkinsfile)

后端 未结 3 499
猫巷女王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:43

    The JIRA Steps Plugin provides a more declarative way to update an existing Jira Ticket:

    node {
      stage('JIRA') {
        # Look at IssueInput class for more information.
        def testIssue = [fields: [ // id or key must present for project.
                                   project: [id: '10000'],
                                   summary: 'New JIRA Created from Jenkins.',
                                   description: 'New JIRA Created from Jenkins.',
                                   customfield_1000: 'customValue',
                                   // id or name must present for issuetype.
                                   issuetype: [id: '3']]]
    
        response = jiraEditIssue idOrKey: 'TEST-01', issue: testIssue
    
        echo response.successful.toString()
        echo response.data.toString()
      }
    }
    

    Since you would like to use the Jenkinsfile to define your pipeline, that should be the preferred way for you to go...

提交回复
热议问题