Jenkins Pipeline
Jenkins 2 brings Pipeline as code, a new setup experience and other UI improvements, let you define delivery pipelines using concise Groovy scripts which deal elegantly with jobs involving persistence and asynchrony. Introduces a domain-specific language (DSL) that helps Jenkins users to model their software delivery pipelines as code, which can be checked in and version-controlled along with the rest of their project’s source code.
JIRA
JIRA is an application that can be used to track all issues for a project. JIRA makes the life cycle of issues transparent and allows for a lot of collaboration. In JIRA you can organize issues, assign work and follow team activity through a workflow. You can do this through UI (Desktop or with new mobile interface). One of the benefits of JIRA is that you can also consume the rest api to automate this workflow. This plugin is wrapper on top of this API to provide more generic steps for Jenkins pipeline developers.
Few examples for a quick reference:
-
Create a JIRA?, see the following, isn’t so simple? :).
def issue = [fields: [ project: [key: 'TESTPRO'], summary: 'New JIRA Created from Jenkins.', description: 'New JIRA Created from Jenkins.', issuetype: [name: 'Task']]] def newIssue = jiraNewIssue issue: issue, site: 'YOURJIRASITE' echo newIssue.data.key
-
Comment on a JIRA?, say just to monitor the status of Jenkins job and here we go.
try { error "Exception" } catch(error) { def comment = "${BUILD_URL} FAILED - ${ERROR}" jiraAddComment idOrKey: 'GENERIC-999', comment: comment, site: 'YOURJIRASITE' currentBuild.result = 'FAILURE' }
-
May be just close the JIRA? cause we just released a project and it is release review JIRA.
// Transition issue ID can differ based on the JIRA instance def transitionInput = [ transition: [ id: 31] ] jiraTransitionIssue idOrKey: 'RELEASE-999', input: transitionInput, site: 'YOURJIRASITE'
-
JIRA transitions for any given ticket can be found via this endpoint:
/rest/api/2/issue/${issueIdOrKey}/transitions
-
There are quite a few steps that this plugin supports currently, and will keep adding more.
Some of the common usage scenarios with multiple steps were available here
Get started by installing this plugin and also refer to the Change Log for more information.