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

Problem with using the jira/notify when your name is not set in circle ci #40

Closed mauriciojovel closed 4 years ago

mauriciojovel commented 4 years ago

Orb version

1.1.4

What happened

When you execute the the jira/notify this execute the following line to verify if your token is valid

verify_api_key () {
  URL="https://circleci.com/api/v2/me"
  fetch $URL /tmp/me.json
  jq -e '.name' /tmp/me.json
}

The problem is for some weird reason my name is not set in the circle ci returning the following output (example api response) { "name": null, "login": "my_login_name", "id": "a numeric id" }

200:https://circleci.com/api/v2/me
null

Exited with code exit status 1

Expected behavior

You need change the look up field for the field login to verify the information.

KyleTryon commented 4 years ago

@mauriciojovel Fixing this right now. I am shocked this was somehow not captured in testing.

Passing the token to the endpoint should resolve this, testing it now.

KyleTryon commented 4 years ago

Hello @mauriciojovel,

Could you please let us know if you are still experiencing this issue in version 1.1.6?

mauriciojovel commented 4 years ago

Hi @KyleTryon,

The problem still in the version 1.1.6

Screenshot 2020-04-08 09 32 39
KyleTryon commented 4 years ago

Hello @mauriciojovel,

We believe the issue may be that a personal access token is not being used: https://github.com/CircleCI-Public/jira-connect-orb/issues/39

could you please verify with a new personal access token that this is still an issue? (not a project token)

if-igor commented 4 years ago

Hi @KyleTryon

I am seeing the exact same issue. I am using a personal token, but my "name" is showing null as well for some reason. I am assuming the name comes from BitBucket, and it's set there, but CircleCi doesn't pick up on it.

I think changing the check from jq -e '.name' /tmp/me.json to jq -e '.login' /tmp/me.json would fix this issue, as the login is there for all users.

KyleTryon commented 4 years ago

https://circleci.com/orbs/registry/orb/circleci/jira 1.1.7 released. Thank you @mauriciojovel . Thank you for confirmation @if-igor, I was able to double-confirm that.

https://github.com/CircleCI-Public/jira-connect-orb/pull/41 is merged.