nishio-dens / bitbucket-pullrequest-builder-plugin

Bitbucket Pull Request Builder Plugin for Jenkins
Other
125 stars 145 forks source link

env.pullRequestAuthor returns <@null> for email address #217

Open RayOei opened 4 years ago

RayOei commented 4 years ago

The pullRequestAuthor environment variable return the name, but not the email. So echo "$env.pullRequestAuthor" returns: Ray Oei <@null> while I would expect: Ray Oei <me@domain.com>

CodeMonk commented 4 years ago

Thank you! I'll look into that ASAP.

dima1308 commented 4 years ago

Any update on this? Can I do something to help to solve it?

CodeMonk commented 4 years ago

The Bitbucket API endpoint: https://bitbucket.org/api/2.0/repositories/ACCOUNT/REPO/pullrequests/

Does NOT return email addresses for users. All you get is this for the author:

"author": {
                "account_id": "HEX_MESS",
                "display_name": "FIRST_NAME LAST_NAME",
                "links": {
                    "avatar": {
                        "href": "https://avatar-management--avatars.us-west-2.prod.public.atl-paas.net/STUFF/UID"
                    },
                    "html": {
                        "href": "https://bitbucket.org/UID_STUFF/"
                    },
                    "self": {
                        "href": "https://bitbucket.org/!api/2.0/users/UID_STUFF"
                    }
                },
                "nickname": "FIRST_NAME LAST_NAME",
                "type": "user",
                "uuid": "{UID}"
            },