- Notifications
You must be signed in to change notification settings - Fork165
Adding Jira integration documentation#208
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Changes fromall commits
55f0737ef415cd97f503101a907792bbf47File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -302,6 +302,8 @@ | ||
| sub-pages: | ||
| - title: Sending the notification to Slack | ||
| url: "/sending-the-notification-to-slack" | ||
| - title: Sending the notification to Jira | ||
| url: "/sending-the-notification-to-jira" | ||
Member There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. You should also add the link herehttps://codefresh.io/docs/docs/yaml-examples/examples/ | ||
| - title: "Security" | ||
| url: "/examples" | ||
| sub-pages: | ||
| @@ -429,8 +431,8 @@ | ||
| sub-pages: | ||
| - title: Slack | ||
| url: "/slack-integration" | ||
| - title: Jira | ||
| url: "/jira-integration" | ||
| - title: Codefresh API | ||
| url: "/codefresh-api" | ||
This file was deleted.
Uh oh!
There was an error while loading.Please reload this page.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,45 @@ | ||
| --- | ||
| title: "Jira Integration" | ||
| description: "" | ||
| group: integrations | ||
| redirect_from: | ||
| - /docs/jira-integration-1/ | ||
| - /docs/integrations/jira-integration-1/ | ||
| toc: true | ||
| --- | ||
| The Jira Issue Manager can either be accessed by adding the plugin to your codefresh.yml file or by adding your own jira-cli to your Dockerfile. | ||
| Prerequisites needed: | ||
| * [Codefresh Account](https://codefresh.io/docs/docs/getting-started/create-a-codefresh-account/) | ||
| * [Have a Jira Account](https://www.atlassian.com/software/jira) | ||
| ## Plugin Marketplace | ||
| The plugin marketplace offers several freestyle steps that can be used in your Codefresh pipeline through plugins. | ||
| One of those plugins is the [Jira Issue Manager](https://codefresh.io/steps/step/jira-issue-manager). It can be used to: | ||
| * Create a Jira issue | ||
| * Comment on existing Jira issues | ||
| * Change the status of an issue e.g. once the build is successful | ||
| * Add a description to your issue | ||
| * And more | ||
| More information on how to use the Jira Issue Manager in your Codefresh pipeline are provided [directly in the example]({{site.baseurl}}/docs/yaml-examples/examples/sending-the-notification-to-jira/). | ||
| ## Using your own jira-cli | ||
| Alternatively, you can use your own jira-cli by adding the following steps to your Dockerfile: | ||
| {% highlight yaml %} | ||
| FROM python:2-alpine | ||
| RUN apk add -U gcc musl-dev linux-headers openssl-dev libffi-dev && pip install jira-cli | ||
| {% endhighlight %} | ||
| And then running the Dockerfile. | ||
| ## What to read next | ||
| * [Example for sending notifications to Jira]({{site.baseurl}}/docs/yaml-examples/examples/sending-the-notification-to-jira/) | ||
| * Have a look at other things that you can do with your Codefresh Pipeline in the [example section]({{site.baseurl}}/docs/yaml-examples/examples/) | ||
| * [Create a pipeline]({{site.baseurl}}/docs/configure-ci-cd-pipeline/pipelines/) |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,88 @@ | ||
| --- | ||
| title: "Sending the notification to Jira" | ||
| description: "" | ||
| group: yaml-examples | ||
| sub_group: examples | ||
| toc: true | ||
| --- | ||
| The plugin marketplace offers several freestyle steps that can be used in your Codefresh pipeline through steps. | ||
| One of those steps is the [Jira Issue Manager](https://codefresh.io/steps/step/jira-issue-manager). | ||
| Prerequisites | ||
| * [Have a Codefresh Pipeline]({{site.baseurl}}/docs/getting-started/create-a-basic-pipeline/) set-up | ||
| * [Have a Jira Account](https://www.atlassian.com/software/jira) | ||
| This documentation is using the following [example](https://github.com/codefresh-contrib/jira-demo-app). You can either use the example provided to try out the Jira integration or follow along with your own application. | ||
| 1. You need an issue in your Jira account that you want to link to your Codefresh pipeline. If you do not have one yet, please create an issue. (Note that the project type and who is creating the issue etc. does not matter.) Alternatively, you can also create an issue first with the Jira step. However, this is not explained in this example. | ||
| 2. Next, add the following step to your Codefresh pipeline. In case that you are using the example, the [codefresh.yml](https://github.com/codefresh-contrib/jira-demo-app/blob/master/codefresh.yml) file is already added. | ||
| {% highlight yaml %} | ||
| JiraCommentCreate: | ||
| title: "Add Jira Comment" | ||
| type: "codefreshdemo/jira-issue-manager" | ||
| stage: "deploy" | ||
| arguments: | ||
| JIRA_BASE_URL: '${{JIRA_BASE_URL}}' | ||
| JIRA_USERNAME: '${{JIRA_USERNAME}}' | ||
| JIRA_API_KEY: '${{JIRA_API_KEY}}' | ||
| JIRA_ISSUE_SOURCE_FIELD: '${{JIRA_ISSUE_SOURCE_FIELD}}' | ||
| ACTION: "comment_create" | ||
| COMMENT_BODY: "Build number ${{CF_BUILD_URL}} finished in Codefresh" | ||
| {% endhighlight yaml %} | ||
| Let's look in detail at this step. | ||
| - Everything up to the arguments is similar to other Codefresh steps. | ||
| These arguments are required to use the step: | ||
| - `JIRA_BASE_URL`: This is the url of your organisation e.g. 'https://company-name.atlassian.net' | ||
| - `JIRA_USERNAME`: This is usually the e-mail that you are logged in with at Jira | ||
| - `JIRA_API_KEY`: Note that you will have to create this key. The official [Atlassian documentation](https://confluence.atlassian.com/cloud/api-tokens-938839638.html) details how it can be created. | ||
| Then we added these arguments for our specific step: | ||
| - `JIRA_ISSUE_SOURCE_FIELD`: This is the tag that identifies your issue e.g. MKTG-102 | ||
| - Within the comment, we are using a [Codefresh native variable](https://codefresh.io/docs/docs/codefresh-yaml/variables/) `CF_BUILD_URL`, which will reference your pipeline build and will allow you to search for your pipeline. | ||
| All variables use the Codefresh specific variable notation ${% raw %}`{{MY_VARIABLE_EXAMPLE}}`{% endraw %}`. | ||
| Since it is a new stage in your Codefresh pipeline, you want to add it at the top to your stages, e.g.: | ||
| {% highlight yaml %} | ||
| stages: | ||
| - "clone" | ||
| - "build" | ||
| - "JiraCommentCreate" | ||
| {% endhighlight yaml %} | ||
| Note that you can [provide the variables]({{site.baseurl}}/docs/configure-ci-cd-pipeline/shared-configuration/) needed for the Jira step directly in the shared configuration. The benefits are: | ||
| * You do not have to post sensitive information, such as the API key, directly in the codefresh.yml. | ||
| * If you use the same step across multiple pipelines, you don't have to copy-paste the same variables. | ||
| Once you run the pipeline, you should be able to see the following output or similar | ||
| {% include image.html | ||
| lightbox="true" | ||
| file="/images/integrations/jira/codefreshpipeline.png" | ||
| url="/images/integrations/jira/codefreshpipeline.png" | ||
| alt="Pipeline with Jira integration" | ||
| max-width="80%" | ||
| %} | ||
| And the comment, including the URL to the pipeline, should be added to your Jira issue: | ||
| {% include image.html | ||
| lightbox="true" | ||
| file="/images/integrations/jira/jira-comment.png" | ||
| url="/images/integrations/jira/jira-comment.png" | ||
| alt="Comment in Jira" | ||
| max-width="80%" | ||
| %} | ||
| ## What to read next | ||
| * [Sending notifications to Slack]({{site.baseurl}}/docs/yaml-examples/examples/sending-the-notification-to-slack/) | ||
| * Have a look at other things that you can do with your Codefresh Pipeline in the [example section]({{site.baseurl}}/docs/yaml-examples/examples/) | ||
| * [Create a pipeline]({{site.baseurl}}/docs/configure-ci-cd-pipeline/pipelines/) |