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 throw error "At least one 'issueKeys' is required" #68

Closed shinji3887 closed 3 years ago

shinji3887 commented 3 years ago

Orb version

circleci/jira@1.3.1

What happened

when i use circleci/jira@1.3.1, i got an error in the step "Update status in Atlassian Jira":

"shinji3887"
This job is passing, however another job in workflow is running
Results from Jira: 

{
  "acceptedBuilds": [],
  "rejectedBuilds": [
    {
      "key": {
        "pipelineId": "jiratest",
        "buildNumber": 13
      },
      "errors": [
        {
          "message": "At least one 'issueKeys' is required"
        }
      ]
    }
  ],
  "unknownIssueKeys": []
}

and i use the example yml in this url : https://circleci.com/developer/orbs/orb/circleci/jira?version=1.3.1 like:

jobs:
  build:
    docker:
      - image: 'circleci/node:10'
    steps:
      - run: echo "hello"
orbs:
  jira: circleci/jira@1.3.1
version: 2.1
workflows:
  build:
    jobs:
      - build:
          post-steps:
            - jira/notify

and my jobs in circle-ci looks work well image please help me.

nbialostosky commented 3 years ago

Hi @shinji3887 !

By default, the Jira Orb has an issue regex of [A-Z]{2,30}-[0-9]+ -- which in this scenario doesn't match the branch you have JF1-13.

Can you try overriding your regex to [A-Z]{2,30}[0-9]-[0-9]+ and see if the Jira orb correctly reports the status back to the issue?

As an example:

jobs:
  build:
    docker:
      - image: 'circleci/node:10'
    steps:
      - run: echo "hello"
orbs:
  jira: circleci/jira@1.3.1
version: 2.1
workflows:
  build:
    jobs:
      - build:
          post-steps:
            - jira/notify:
                issue_regexp: '[A-Z]{2,30}[0-9]-[0-9]+'
shinji3887 commented 3 years ago

Hi @shinji3887 !

By default, the Jira Orb has an issue regex of [A-Z]{2,30}-[0-9]+ -- which in this scenario doesn't match the branch you have JF1-13.

Can you try overriding your regex to [A-Z]{2,30}[0-9]-[0-9]+ and see if the Jira orb correctly reports the status back to the issue?

As an example:

jobs:
  build:
    docker:
      - image: 'circleci/node:10'
    steps:
      - run: echo "hello"
orbs:
  jira: circleci/jira@1.3.1
version: 2.1
workflows:
  build:
    jobs:
      - build:
          post-steps:
            - jira/notify:
                issue_regexp: '[A-Z]{2,30}[0-9]-[0-9]+'

thx very much! it works for me!

nbialostosky commented 3 years ago

Awesome, thanks for the reply and confirmation, happy to hear it!