CircleCI-Public / jira-connect-orb

Display the status of CircleCI workflows and deployments in Jira!
https://circleci.com/orbs/registry/orb/circleci/jira
MIT License
25 stars 27 forks source link

Jira orb with Fastlane not working #59

Closed nataliakuznetsova closed 3 years ago

nataliakuznetsova commented 3 years ago

Orb version

1.3.0

What happened

I am trying to integrate the orb for my build and release pipeline for an Android project. There is a job for build and test step. Adding "jira/notify" works well.

In addition to that I am trying to add a "jira/notify" for a deployment. The job is triggered via fastlane lane. When inluding the command with default values, it works well, but when adding the job_type and environment_type it fails on CircleCI with error:

Cannot find a definition for command named notify

Error calling job: 'assemble_beta_apk_with_firebase'

Error calling workflow: 'assemble_beta_apk_with_firebase'

Here is the job definition, some parts are omitted.

Configuration that works:

version: 2.1

orbs:
    jira: circleci/jira@1.3.0

...

  assemble_beta_apk_with_firebase:
    <<: *android_config
    environment:
    steps:
      - *checkout_code
      - *android_dependencies
      - run:
          name: Clean old APK's
          command: |
            cd workspace/App
            ./gradlew clean
      - run:
          name: Install Firebase CLI
          command: |
            curl -sL firebase.tools | bash
      - run:
          name: Build beta APKs and upload to Firebase App Distribution
          command: |
            cd workspace/App
            bundle exec fastlane android distribute_branch_with_temp_version_name branch_name:${CIRCLE_BRANCH}`
      - jira/notify

...

Configuration that produced the error:

version: 2.1

orbs:
    jira: circleci/jira@1.3.0

...

  assemble_beta_apk_with_firebase:
    <<: *android_config
    environment:
    steps:
      - *checkout_code
      - *android_dependencies
      - run:
          name: Clean old APK's
          command: |
            cd workspace/App
            ./gradlew clean
      - run:
          name: Install Firebase CLI
          command: |
            curl -sL firebase.tools | bash
      - run:
          name: Build beta APKs and upload to Firebase App Distribution
          command: |
            cd workspace/App
            bundle exec fastlane android distribute_branch_with_temp_version_name branch_name:${CIRCLE_BRANCH}`
      - jira/notify:
          environment_type: testing
          job_type: deployment

...

Expected behavior

nataliakuznetsova commented 3 years ago

The issue is fixed. The problem was incompatible APIs. I was using Circle CI api v1.1 to trigger the job which is not compatible with with config 2.1. Migrating to circle CI API version 2 fixed the issue