Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

Merged
kostis-codefresh merged 5 commits intomasterfromjira-step
Feb 1, 2021
Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions_data/nav.yml
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -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"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

- title: "Security"
url: "/examples"
sub-pages:
Expand DownExpand Up@@ -429,8 +431,8 @@
sub-pages:
- title: Slack
url: "/slack-integration"
- title: Jira Integration
url: "/jira-integration"
- title: Jira
url: "/jira-integration"
- title: Codefresh API
url: "/codefresh-api"

Expand Down
13 changes: 0 additions & 13 deletions_docs/integrations/jira-integration.md
View file
Open in desktop

This file was deleted.

2 changes: 2 additions & 0 deletions_docs/integrations/notifications.md
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -11,3 +11,5 @@ Codefresh enables you to send notifications about events.
Codefresh supports the following notification channels:
- Email
- [Slack]({{ site.baseurl }}/docs/integrations/notifications/slack-integration/)
- [Jira]({{ site.baseurl }}/docs/integrations/notifications/jira-integration/)

45 changes: 45 additions & 0 deletions_docs/integrations/notifications/jira-integration.md
View file
Open in desktop
Original file line numberDiff line numberDiff 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/)
2 changes: 1 addition & 1 deletion_docs/whats-new/whats-new.md
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -11,9 +11,9 @@ toc: true

### February 2021

- Jira integration - [documentation]({{site.baseurl}}/docs/yaml-examples/examples/sending-the-notification-to-jira/)
- SLA details - [documentation]({{site.baseurl}}/docs/terms-and-privacy-policy/sla/)


### January 2021

- Using external secrets in Codefresh GUI - [documentation]({{site.baseurl}}/docs/configure-ci-cd-pipeline/secrets-store/#using-secrets-in-the-codefresh-gui)
Expand Down
1 change: 1 addition & 0 deletions_docs/yaml-examples/examples.md
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -111,3 +111,4 @@ Codefresh can deploy to any platform such as VMs, FTP/SSH/S3 sites, app servers
## Notifications

- [Sending the notification to Slack]({{site.baseurl}}/docs/yaml-examples/examples/sending-the-notification-to-slack)
- [Sending the notification to Jira]({{site.baseurl}}/docs/yaml-examples/examples/sending-the-notification-to-jira)
View file
Open in desktop
Original file line numberDiff line numberDiff 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/)
View file
Open in desktop
Loading
Sorry, something went wrong.Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file addedimages/integrations/jira/jira-comment.png
View file
Open in desktop
Loading
Sorry, something went wrong.Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

[8]ページ先頭

©2009-2025 Movatter.jp