|
| 1 | +# Jira Issue Updater |
| 2 | + |
| 3 | +## Introduction |
| 4 | +The Jira Issue Updater plugin extends the capabilities of Devtron CI by allowing updates to Jira issues directly from the pipeline. It can add build pipeline status and docker image ID as a comment on Jira tickets, keeping the issue tracking synchronized with your CI processes. |
| 5 | + |
| 6 | +### Prerequisites |
| 7 | + |
| 8 | +- A Jira account with the necessary [API access](https://support.atlassian.com/atlassian-account/docs/manage-api-tokens-for-your-atlassian-account/#Create-an-API-token). |
| 9 | +- The API credentials (username, password, and base URL) for your Jira instance. Obtain the API credentials from your Jira admin if required. |
| 10 | +- A pull request raised with your Git provider. Title of pull request must contain the Jira ID. |
| 11 | +- Jira Issue (e.g., REDOC-12) |
| 12 | +- Webhook added to the git repository. [Click here](https://docs.devtron.ai/usage/applications/creating-application/workflow/ci-pipeline#configuring-webhook) to know more. |
| 13 | + |
| 14 | +--- |
| 15 | + |
| 16 | +## Steps |
| 17 | + |
| 18 | +1. On the **Edit build pipeline** page, go to the **Post-Build Stage**. |
| 19 | +2. Click **+ Add task**. |
| 20 | +3. Select **Jira Issue Updater** from the list of plugins. |
| 21 | + * Enter a task name (mandatory). |
| 22 | + * Optionally, enter a description. |
| 23 | + * Provide values for the input variables. |
| 24 | + |
| 25 | + | Variable | Format | Description | |
| 26 | + | ------------------------ | ------ | --------------------------------------------------------- | |
| 27 | + | JiraUsername | String | Your Jira username (e.g., [email protected]) | |
| 28 | + | JiraPassword | String | Your Jira API token provided by the Jira admin | |
| 29 | + | JiraBaseUrl | String | The base URL of your Jira instance (e.g., https://yourdomain.atlassian.net/) | |
| 30 | + | UpdateWithDockerImageId | Bool | Set to `true` to include the Docker Image ID in the update | |
| 31 | + | UpdateWithBuildStatus | Bool | Set to `true` to include the build status in the update | |
| 32 | + |
| 33 | + * `Trigger/Skip Condition` allows you to set conditions under which this task will execute or be skipped. |
| 34 | + * `Pass/Failure Condition` allows you define conditions to determine if the build passes or fails based on the Jira update. |
| 35 | + |
| 36 | +4. Go to the **Build Stage**. |
| 37 | + |
| 38 | +5. Select **Pull Request** in the **Source Type** dropdown. |
| 39 | + |
| 40 | +6. Use filters to fetch only the PRs matching your regex. Here are few examples: |
| 41 | + * **Title** can be a regex pattern (e.g., `^(?P<jira_Id>([a-zA-Z0-9-].*))`) to extract the Jira ID from the PR title. Only those PRs fulfilling the regex will be shown for image build process. |
| 42 | + * **State** can be `^open$`, where only PRs in open state will be shown for image build process. |
| 43 | + |
| 44 | +7. Click **Update Pipeline**. |
| 45 | + |
| 46 | +--- |
| 47 | + |
| 48 | +## Results |
| 49 | + |
| 50 | + |
| 51 | + |
| 52 | + |
| 53 | + |
| 54 | + |
| 55 | + |
| 56 | + |
| 57 | + |
0 commit comments