> For the complete documentation index, see [llms.txt](https://developer.harness.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.harness.io/continuous-delivery/use-continuous-delivery/cd-building-blocks/cd-steps/ticketing-systems/update-jira-issues-in-cd-stages.md).

# Update Jira issues in CD stages

Update a Jira issue from a Harness CD or Approval stage using the Update Jira step.

This topic describes how to update a Jira issue using the Update Jira step. You can add the Update Jira step to a Harness CD stage or an Approval stage.

You can also [create Jira issues](/continuous-delivery/use-continuous-delivery/cd-building-blocks/cd-steps/ticketing-systems/create-jira-issues-in-cd-stages.md) and [add Jira approval stages and steps](https://developer.harness.io/docs/platform/approvals/adding-jira-approval-stages).

***

## What you will learn from this topic

* How to [add a Jira Update step](#add-a-jira-update-step) to a stage.
* How to [use an expression in Issue Key](#use-an-expression-in-issue-key) to update an issue created by a Jira Create step.
* How to set [optional configuration](#optional-configuration), [issue fields](#add-issue-fields), [date fields](#jira-date-field-support), and the [issue type](#update-issue-type-field-support).
* How to [update the Jira Deployment or Build fields](#update-jira-deployment-or-build-fields) and [parent issues](#parent-issue-support).
* How to [apply and test](#apply-and-test) the step.

***

## Before you begin

The following prerequisites apply to the Jira Update step:

* **Jira connector**: You can add a Harness Jira connector before or during the Update Jira step setup. Go to [Connect to Jira](https://developer.harness.io/docs/platform/connectors/ticketing-systems/connect-to-jira) to create one.
* **Jira approval stages and steps**: Go to [Adding Jira approval stages and steps](https://developer.harness.io/docs/platform/approvals/adding-jira-approval-stages) for background on how approval stages use Jira issues.

***

## Limitations

The Jira Update step has the following limitations:

* Harness supports only Jira fields of type `User`, `Option`, `Array`, `Any`, `Number`, `Date`, and `String`. This excludes [multi-value](https://support.atlassian.com/jira-cloud-administration/docs/custom-fields-types-in-company-managed-projects/) fields that let a user select multiple options from a dropdown list.
* Harness does not integrate with Jira fields that manage issue links or attachments.
* The Jira Update step manages standard Jira issue fields. It does not update the **Deployment** or **Build** fields under the **Development** tab on Jira issues. To update those fields, use the [Jira Plugin step](https://developer.harness.io/docs/continuous-integration/use-harness-ci/use-harness-ci/use-drone-plugins/ci-jira-int-plugin#how-does-harness-determine-which-jira-field-to-update) in your pipeline.
* You can add unsupported Jira fields using an HTTP step. Go to [Use the HTTP step to set unsupported fields when creating Jira issues](/continuous-delivery/use-continuous-delivery/cd-building-blocks/cd-steps/ticketing-systems/create-cascading-fields-jira.md) for details.

***

## Add a Jira Update step

Perform the following steps to add a Jira Update step:

1. In a Harness CD or Approval stage, in **Execution**, select **Add Step**.
2. Select **Jira Update**. The Jira Update step appears.

   ![Jira Update step added to a stage execution](https://3694223630-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fy1JhZ4oKIppwY7d5AhPj%2Fuploads%2Fgit-blob-8389d550dbcd9517caa70ebc297bd8788dc92143%2Fupdate-jira-issues-in-cd-stages-14.png?alt=media)
3. In **Name**, enter a name that describes the step.
4. In **Timeout**, enter how long you want Harness to try to update the issue before failing (and initiating the stage or step [failure strategy](https://developer.harness.io/docs/platform/pipelines/failure-handling/define-a-failure-strategy-on-stages-and-steps)).
5. In **Jira Connector**, create or select the [Jira connector](https://developer.harness.io/docs/platform/connectors/ticketing-systems/connect-to-jira) to use.
6. In **Issue Key**, enter the Jira issue key of the issue you want to update.
7. Select **Apply Changes**.
8. Select **Save**.

***

## Use an expression in Issue Key

In **Issue Key**, you can use an expression or runtime input to reference the Key ID from another Jira Create or Jira Update step.

Consider the following when you use an expression in **Issue Key**:

{% hint style="warning" %}
**Step order and issue mismatch**

* The Jira Create or Jira Update step you want to reference must come before the Jira Update step that references it in the stage.
* Harness uses the **Jira Project** and **Issue Type** you select in **Add Jira Fields** to fetch the list of fields. If you use a runtime input or expression for **Issue Key** and the Jira Project and Issue Type you selected does not correspond with the issue key resolved at runtime, your pipeline can fail to execute successfully.
  {% endhint %}

Perform the following steps to use an expression in **Issue Key**:

1. Identify the step where you want to get the ID from. This example uses a Jira Create step.

   Close the Jira Update step to get the ID from the previous step. An ID is required, so enter any number for now and select **Save**. In the pipeline, select **Execution History**.
2. Select a successful execution, and select the Jira Create step in the execution.
3. Select the **Output** tab, locate the **Key** setting, and select the copy button.

   ![Output tab showing the Key setting for a Jira Create step](https://3694223630-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fy1JhZ4oKIppwY7d5AhPj%2Fuploads%2Fgit-blob-5fdab13b7cde0552a6384330f8a440bb2af59bc4%2Fadding-jira-approval-stages-09.png?alt=media)

   The expression looks similar to the following:

   `<+pipeline.stages.Jira_Stage.spec.execution.steps.jiraCreate.issue.key>`

   This expression references the key ID from this step.
4. Go back to your Jira Update step. Select **Edit Pipeline**.
5. In **Issue Key**, select **Expression**.

   ![Issue Key field set to Expression mode](https://3694223630-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fy1JhZ4oKIppwY7d5AhPj%2Fuploads%2Fgit-blob-4029ee12be014093b245503f7a44e6aa80ad04f8%2Fupdate-jira-issues-in-cd-stages-16.png?alt=media)
6. In **Issue Key**, paste in the expression you copied from the previous Jira Create step.

   The Jira Update step now updates the issue created by the Jira Create step.

{% hint style="warning" %}
**Each Jira Create run produces a new issue**

When you use a Jira Create step, it creates a new, independent Jira issue every time it runs. If you reuse the same issue ID in Jira Update, you update a new issue on every run.
{% endhint %}

***

## Optional configuration

In **Optional Configuration**, you can set the following options:

* **Status**: Enter the status type (Issue Action) to update the issue with, for example In Progress or Done. Harness automatically updates the issue with this status.
* **Transition Name**: Enter the name of the transition to move the issue into, for example `Transition to`, `PR Testing`, or `Ready for Test`.

{% hint style="warning" %}
**Transition requires a Jira workflow**

If the issue is not part of a Jira workflow and does not have transition options, the step fails. Go to [statuses and transitions](https://support.atlassian.com/jira-cloud-administration/docs/work-with-issue-workflows/#Workingwithworkflows-steps) from Atlassian to review workflow transitions.
{% endhint %}

***

## Add issue fields

You can select specific fields to update within a Jira issue. Go to [Jira custom fields](https://support.atlassian.com/jira-cloud-administration/docs/custom-fields-types-in-company-managed-projects/) to review custom field types.

Go to [Limitations](#limitations) to review the supported issue fields and other limitations.

### Reference Jira fields with spaces or special characters in expressions

When you need to reference Jira custom field values using Harness expressions, for example in conditional execution, approval criteria, or when passing values between steps, enclose fields that contain spaces or special characters in **single quotes** (`'`).

The following examples show the correct syntax.

**Fields with spaces**: use single quotes.

```
<+pipeline.stages.Jira_Stage.spec.execution.steps.Jira_Update.issue.'Risk Level'>
<+execution.steps.jiraUpdate.issue.'Custom Field'>
```

**Fields without spaces**: no quotes are needed.

```
<+execution.steps.jiraUpdate.issue.Status>
<+execution.steps.jiraUpdate.issue.Priority>
```

**Using in conditional expressions**: the same quoting rule applies.

```
<+execution.steps.jiraUpdate.issue.'Risk Level'> == "High"
```

{% hint style="info" %}
When you reference a Jira issue field that the Jira Update step updated, in a later step or expression, use single quotes around any field name that contains spaces or special characters.
{% endhint %}

In **Optional Configuration**, select **+ Fields** to add Jira fields.

![Add Jira Fields dialog with the plus Fields option](https://3694223630-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fy1JhZ4oKIppwY7d5AhPj%2Fuploads%2Fgit-blob-ad25fbc111df08d581d3036e20a674959809e65a%2Fadd-jira-fields.png?alt=media)

***

## Jira date field support

Among the custom fields Harness supports are Baseline End Date and Start Date Time. If your Jira project uses these fields, they are available in **Fields**:

![Baseline End Date and Start Date Time fields available for selection](https://3694223630-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fy1JhZ4oKIppwY7d5AhPj%2Fuploads%2Fgit-blob-6a8d938b977e20ce8b02992cb0966f64c6226833%2Fupdate-jira-issues-in-cd-stages-19.png?alt=media)

After you select these fields, their settings appear.

![Date field settings after selecting a Jira date field](https://3694223630-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fy1JhZ4oKIppwY7d5AhPj%2Fuploads%2Fgit-blob-9c1b238d3dc809ea3afd8e5672ed9de06ad5d037%2Fupdate-jira-issues-in-cd-stages-20.png?alt=media)

You can also set advanced dates using stage variables and the `current()` function. The following examples show the syntax:

* `<+currentDate().plusDays(2).plusMonths(1)>`: current date plus one month and two days.
* `<+currentTime()>`: for current date time fields.

Harness supports the following functions.

For date-only fields, use:

`currentDate().plusYears(1).plusMonths(1).plusWeeks(1).plusDays(1)`

For date and time fields, use:

`currentTime().plusYears(1).plusMonths(1).plusWeeks(1).plusDays(1).plusHours(1).plusMinutes(1).plusSeconds(1).plusNanos(1)`

The number 1 is used as an example. You can enter whatever number you need.

***

## Update Issue Type field support

Harness supports updating the Jira Issue Type. Perform the following steps to update it:

1. Enter an **Issue Key** in the Jira Update step.
2. In the **Add Jira Fields** dialog, select **Issue Type**, then select **Add**. The **Issue Type** field appears under **Optional Configuration**.

   ![Issue Type field added under Optional Configuration](https://3694223630-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fy1JhZ4oKIppwY7d5AhPj%2Fuploads%2Fgit-blob-d00761ea2fc5746cebadffa93756304f13dd256a%2Fmodify-issue-type.png?alt=media)
3. Select a new issue type to modify the Issue Type of the selected Jira issue, and select **Apply Changes**.

   ![New issue type selected and ready to apply](https://3694223630-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fy1JhZ4oKIppwY7d5AhPj%2Fuploads%2Fgit-blob-1d45f4e9a4c542f8af5bb3b2653ef814425e32a0%2Fupdate-issue-type.png?alt=media)

The issue type for the selected Jira issue is now updated with the issue type you selected.

***

## Update Jira Deployment or Build fields

The **Deployment** and **Build** fields under the **Development** tab on a Jira issue are managed through the Jira Development API. This is separate from the standard Jira issue fields API that the Jira Update step uses.

If you select the **Environment** field in the Jira Update step's **Add Jira Fields** dialog, it updates the standard Jira **Environment** field on the issue. It does not update the **Deployment** or **Build** fields under the **Development** tab.

To update the **Deployment** or **Build** fields, use the **Plugin** step with the `plugins/jira` image instead. The `ENVIRONMENT_NAME` setting in the Plugin step controls which field is updated:

* **With `ENVIRONMENT_NAME`**: Harness updates the Jira **Deployment** field.
* **Without `ENVIRONMENT_NAME`**: Harness updates the Jira **Build** field.

For setup instructions, go to [Integrate Jira in a CI pipeline](https://developer.harness.io/docs/continuous-integration/use-harness-ci/use-harness-ci/use-drone-plugins/ci-jira-int-plugin#how-does-harness-determine-which-jira-field-to-update).

{% hint style="warning" %}
Do not confuse the standard Jira **Environment** field with the **Deployment** field under the **Development** tab. Setting the Environment field in the Jira Update step only updates the issue-level Environment field, not the Development tab's Deployment tracking.
{% endhint %}

***

## Advanced settings

In **Advanced**, you can configure the following options for the step:

* [Delegate Selector](https://developer.harness.io/docs/platform/delegates/delegate/manage-delegates/select-delegates-with-selectors)
* [Conditional Execution](https://developer.harness.io/docs/platform/pipelines/step-skip-condition-settings)
* [Failure Strategy](https://developer.harness.io/docs/platform/pipelines/failure-handling/define-a-failure-strategy-on-stages-and-steps)
* [Looping Strategy](https://developer.harness.io/docs/platform/pipelines/looping-strategies/looping-strategies-matrix-repeat-and-parallelism)
* [Policy Enforcement](https://developer.harness.io/docs/platform/governance/policy-as-code/harness-governance-overview)

***

## Apply and test

Perform the following steps to apply changes and test the step:

1. Select **Apply Changes**. The Jira Update step is added to the stage.
2. Run the pipeline.
3. In the pipeline execution view, select the **Jira Update** step, and then select the **Output** tab. You can see all of the fields for the Jira issue you updated.
4. Locate **URL** and copy its value.

   ![Output tab showing the URL field for the updated Jira issue](https://3694223630-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fy1JhZ4oKIppwY7d5AhPj%2Fuploads%2Fgit-blob-1d28d1dbb01f73e74abecab8d3a32a830b9d2202%2Fcreate-jira-issues-in-cd-stages-04.png?alt=media)
5. In a new browser tab, paste the URL and click **Enter**.

   The updated issue appears in Jira.

***

## Parent issue support

Harness supports parent links through the `issuelink` field in Jira.

This support enables you to do the following:

* Use the Jira Create step to create issues with existing issues as their parent.
* Use the Jira Update step to update the parent of a specific issue.
* Create a sub-task using the Jira Create step.
* Provide a ticket parent by entering the parent issue key in the **Parent** setting, such as `TJI-47890`.

Perform the following steps to use parent links:

1. In the Jira Create or Update step, select **Optional Configuration**.
2. Select **Fields**.
3. In **Add Jira Fields**, select **Parent**, and select **Add**.

   ![Parent field added in the Add Jira Fields dialog](https://3694223630-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fy1JhZ4oKIppwY7d5AhPj%2Fuploads%2Fgit-blob-840d7385bbe7d25e9f6cd1a3d1d63d8e85dd9ff4%2Fcab823f2e376787040c80df674c55ea77863f3bca861a50d50052f7014893adf.png?alt=media)
4. In the **Value** for **Parent**, enter the parent issue key.

   ![Parent issue key entered in the Value field](https://3694223630-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fy1JhZ4oKIppwY7d5AhPj%2Fuploads%2Fgit-blob-a7e802c3971b1deca26d43d43db942014f94f59a%2Fc459f24248f46e308d03f01250b477480e555e8407bbfd1c6aa811a5054d0ef4.png?alt=media)

***

## Next steps

* [Create Jira issues in CD stages](/continuous-delivery/use-continuous-delivery/cd-building-blocks/cd-steps/ticketing-systems/create-jira-issues-in-cd-stages.md): Create a new Jira issue from a Harness CD or Approval stage.
* [Adding Jira approval stages and steps](https://developer.harness.io/docs/platform/approvals/adding-jira-approval-stages): Gate a pipeline on manual approval through a Jira issue.
* [Create ServiceNow tickets in CD stages](/continuous-delivery/use-continuous-delivery/cd-building-blocks/cd-steps/ticketing-systems/create-service-now-tickets-in-cd-stages.md): Use the ServiceNow equivalent of this step.
