For the complete documentation index, see llms.txt. This page is also available as Markdown.

Use the HTTP step to set unsupported fields when creating Jira issues

Instructions on setting unsupported fields when creating a JIRA issue using the HTTP step.

This article talks about using the HTTP step to set the fields that are not supported by Harness using an example.

By default, Harness doesn't support cascading lists and other custom field types. For the list of supported Jira fields, go to Add issue fields.

We will discuss how to set a cascading list using the HTTP step. This unblocks integration with Jira projects that mark such fields as mandatory.

Create a pipeline with a Custom stage and configure the following steps under the Execution tab of the pipeline.

Configure the HTTP step

In the HTTP step's Step Parameters, configure the following fields.

  • URL: Enter your Jira server details. For example, https://<your_JIRA_domain>/rest/api/2/issue.

  • Method: Select POST HTTP method.

  • Request Body: Enter the cURL command to create a task in project TES with a summary and cascading field with ID customfield_10500. Here's a sample:

    {
    "fields": {
      "project": { 
        "key": "TES"
       },
      "summary": "Testing select list (cascading)",
      "issuetype": {
        "id": "10003"
       },
      "customfield_10500": {
        "value": "Parent 1",
        "child": {
          "value": "P1 Child 1"
        }      
      }
     }
    }
  • Optional Configuration: Enter the following optional configurations.

    • Headers: Enter the following Key:Value information:

      • Content-Type: application/json

      • Authorization: Basic <authorization_key_to_your_Jira_server>

    • Output: Enter the variable name and value to get the Jira Issue Id from the pipeline output. For example:

      • Variable Name: <issue_key>

      • Value: Choose Expression input type and enter <+json.select("key", httpResponseBody)>

Configure the Jira Update step

Now, create a Jira Update step to update the Jira issue as a step during pipeline execution.

In the Jira Update step's Step Parameters, configure the following fields.

  • Jira Connector: Select your Jira connector.

  • Issue Key: Enter the Jira issue key as an expression: <+pipeline.stages.testJiraCustomFields.spec.execution.steps.Http_1.output.outputVariables.issue_key>.

Sample pipeline YAML

Here's a sample pipeline:

Viewing the cascading list in the Jira issue

After configuring the HTTP and Jira Update steps, run the pipeline. From the pipeline Output tab, copy the issue URL. In the Jira issue, you can see the cascading field as shown in the image below:

Last updated

Was this helpful?