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

Successful status not being posted to JIRA #6

Closed levlaz closed 5 years ago

levlaz commented 5 years ago

I am opening this on behalf of a customer who wrote in to support.

Orb version

circleci/jira@1.0.2

What happened

The build passed and the success condition was set.

echo 'export JIRA_BUILD_STATUS="successful"' >> $BASH_ENV

When attempting to post this to JIRA the following error message is displayed.

Attempt to get Jira Issues from  https://circleci.com/api/v1.1/project/github/$REDACTED/1151
Associating build with [
  "CS-613",
  "CS-613"
] on 
{"acceptedDeployments":[],"rejectedDeployments":[{"key":{"pipelineId":"service-public-api-old","environmentId":"4e16cfe8-f6a1-4336-8f8f-8f02c0632bb5-deploy-development","deploymentSequenceNumber":1151},"errors":[{"message":"'state' is required"},{"message":"'state' is not valid. Allowed values are: [pending, in_progress, successful, cancelled, failed, rolled_back, unknown]."}]}],"unknownIssueKeys":[]}Success!

Expected behavior

The success status is posted to JIRA without issue.

iynere commented 5 years ago

@levlaz do you have a CircleCI job link for this issue ? thank you !!

levlaz commented 5 years ago

@iynere I do, but since this came from support I wasn't sure if I should make this public. Do you have a preferred method in mind for my own knowledge going forward? I am happy to send it over internally.

eddiewebb commented 5 years ago

@levlaz - I think it's be safe to reference any Zendesk ticket #'s going forward, and we can dig up any internal details as needed (@iynere push back if you still dont have ZD access).

iynere commented 5 years ago

@levlaz the work on these is all open-source, so i'd encourage you / anyone to, when responding to these types of support tickets: a) encourage customers to file issues themselves, directly; and b) if you're going to open an issue for them, ask their permission to drop the job link in the issue

levlaz commented 5 years ago

Thanks for the direction @eddiewebb and @iynere

The ticket number is: 50742

I asked permission to post the link here, and if they say yes we will update the ticket.

For future reference, we will keep this in mind to prevent this back and fourth.

eddiewebb commented 5 years ago

The underlying issues seems to be the use of $BASH_ENV not properly conveying the state, I suspect due to advanced use of their environment config. This method is not portable enough, and so we should write a temp file instead to bass between the success/fail and publish steps.